Deleting a node in a circular linked list c++?
- by angad Soni
I was wondering if anyone could help me understand if this code for deleting a node from a circular linked list would work, or if there is something i'm missing out on.
using c++ to code.
void circularList::deleteNode(int x)
{
node *current;
node *temp;
current = this-start;
while(current->next != this->start)
{
if(current->next->value == x)
{
temp = current->next;
current->next = current->next->next;
delete current->next;
}
}
}