This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct node | |
{ | |
int n; | |
struct node *next; | |
} | |
node; | |
bool search(int n, node* list) | |
{ | |
node* ptr = list; | |
while (ptr != NULL) | |
{ | |
if (ptr->n == n) | |
{ | |
return true; | |
} | |
ptr = ptr->next; | |
} | |
return false; | |
} |
No comments:
Post a Comment