Trouble with a sequential search algorithm

Posted by shinjuo on Stack Overflow See other posts from Stack Overflow or by shinjuo
Published on 2010-05-04T06:16:44Z Indexed on 2010/05/04 6:28 UTC
Read the original article Hit count: 241

Filed under:
|

I need to use this sequential search algorithm, but I am not really sure how. I need to use it with an array. Can someone point me in the correct direction or something on how to use this.

bool seqSearch (int list[], int last, int target, int* locn){
     int looker;

     looker = 0;
     while(looker < last && target != list[looker]){
                  looker++;
     }

     *locn = looker;
     return(target == list[looker]);
}

© Stack Overflow or respective owner

Related posts about c

    Related posts about sequential