Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions C++/LinkedList/Cricular linklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Function to print nodes in
a given Circular linked list */
void printList(Node* head)
{
Node* temp = head;

// If linked list is not empty
if (head != NULL) {

// Print nodes till we reach first node again
do {
cout << temp->data << " ";
temp = temp->next;
} while (temp != head);
}
}

// This code is contributed by rajsanghavi9