[Solved] Printing the Circular linked list


All you have to do is just adding a single line after the do-while loop as follows:

do
{
    cout << temp->data << "->";
    temp = temp->link;
} while (temp != front);
cout<< front->data << "->";

assuming front is the head of your linked-list. Now I’ve a question for you, what you gonna do if there is a single entry? Since it is going to be displayed twice.

solved Printing the Circular linked list