Added count feature

This commit is contained in:
SF
2026-07-30 06:49:33 +00:00
parent dc5257ce84
commit 280758e7b5
4 changed files with 17 additions and 0 deletions
+14
View File
@@ -41,3 +41,17 @@ int search(int value)
return 0;
}
int count()
{
int count = 0;
Node *temp = head;
while (temp != NULL)
{
count++;
temp = temp->next;
}
return count;
}