pls can u check my program in search operation i am not able to print the last element .
Regarding doubly circular linked list
i think you have shared the wrong code
No i have 2 doubts one is the code of singly circular linked list and other is of doubly circular linked list so pls can u check and tell me , i have raised 2 doubts so i dont remember which one was first so…
Okay no its the doubt of doubly circular linked so in this if i am searching an elemenet all the elements are coming but if i searched the last one then it shows not found so pls check error and tell me
cout<<“1. Insert First”<<endl;
cout<<“2. Insert Last”<<endl;
cout<<“3. Display”<<endl;
cout<<“4. Delete First”<<endl;
cout<<“5. Delete Last”<<endl;
cout<<“6. Search”<<endl;
cout<<“7. Exit”<<endl;
why do u have all these?
this is the basic way
bool search(struct Node* head, int x)
{
// Base case
if (head == NULL)
return false;
// If key is present in current node, return true
if (head->key == x)
return true;
// Recur for remaining list
return search(head->next, x);
}