Professional Documents
Culture Documents
2 GPT Promp Refs
2 GPT Promp Refs
2 GPT Promp Refs
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
int main() {
struct Node* head = NULL;
struct Node* second = NULL;
struct Node* third = NULL;
head->data = 1;
head->next = second;
second->data = 2;
second->next = third;
third->data = 3;
third->next = NULL;
int item_to_find = 2;
if (search(head, item_to_find))
printf("Element %d is present in the list\n", item_to_find);
else
printf("Element %d is not present in the list\n", item_to_find);
printList(head);
return 0;
}