Compare commits

..
9 Commits
Author SHA1 Message Date
Shifa 2efbc6e1cb Merge branch 'feature' 2026-08-04 07:35:53 +00:00
Shifa 654eae8007 added a statement 2026-08-04 07:26:44 +00:00
Shifa 3ccfb3e420 added feature 2026-08-04 07:21:27 +00:00
Shifa 08aa0d19e8 added printf 2026-08-03 09:37:37 +00:00
Shifa 791b774d2f Merge branch 'main' of http://13.234.246.121:3000/bjayesh/shifalearn 2026-08-03 09:18:55 +00:00
Shifa b63c9f1ccb added a statement 2026-08-03 09:10:24 +00:00
shifa.f d1e0062ae7 Update main.c 2026-07-31 09:35:57 +00:00
Shifa 38837667c2 added a message in main.c 2026-07-31 07:10:41 +00:00
Shifa 6c9f757c62 modified search feature 2026-07-30 10:07:05 +00:00
4 changed files with 18 additions and 8 deletions
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -25,7 +25,7 @@ void display()
} }
} }
int search(int value) Node *search(int value)
{ {
Node *temp = head; Node *temp = head;
@@ -33,13 +33,13 @@ int search(int value)
{ {
if (temp->data == value) if (temp->data == value)
{ {
return 1; return temp;
} }
temp = temp->next; temp = temp->next;
} }
return 0; return NULL;
} }
int count() int count()
+1 -1
View File
@@ -11,7 +11,7 @@ typedef struct Node
void insert(int data); void insert(int data);
void display(); void display();
int search(int value); Node *search(int value);
int count(); int count();
#endif #endif
+14 -4
View File
@@ -6,18 +6,28 @@ int main()
insert(10); insert(10);
insert(20); insert(20);
insert(30); insert(30);
printf("Linked List: ");
display(); display();
if (search(20)) Node *result = search(20);
if (result != NULL)
{ {
printf("\nElement found\n"); printf("\n the Element found: %d\n", result->data);
} }
else else
{ {
printf("\nElement not found\n"); printf("\n the Element not found\n");
} }
printf("Total nodes = %d\n", count());
printf("Total nodes = %d\n", count());
printf("Count operation completes.\n");
printf("\nThis is Main Branch\n");
printf("\nThis is Feature Branch\n");
return 0; return 0;
} }