Advertisement
Fede

Untitled

Dec 22nd, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. typedef int Boolean;
  2. #define TRUE 1
  3. #define FALSE
  4.  
  5. struct data{
  6.  float key;
  7.  //...
  8. };
  9.  
  10. Boolean sequential_search(struct data * V, int N, struct data target){
  11.  Boolean found = FALSE;
  12.  int count = 0;
  13.  while(count<N && found==FALSE){
  14.   if(V[count].key == target.key)
  15.    found = TRUE;
  16.   else
  17.    count++;
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement