Complete the code to start traversal from the head node.
Node current = [1];Traversal of a circular linked list starts from the head node.
Complete the code to move to the next node during traversal.
current = current.[1];To traverse a linked list, move to the next node from the current node.
Fix the error in the loop condition to stop traversal after one full cycle.
do {
Console.WriteLine(current.data);
current = current.next;
} while (current != [1]);Traversal stops when current reaches back to the head node, completing one full cycle.
Fill both blanks to correctly print all nodes including the head once.
do {
Console.WriteLine(current.data);
current = current.[1];
} while (current != [2]);The do-while loop prints the current node's data, moves to the next node, and stops when it reaches back to the head.
Fill all three blanks to create a method that traverses and prints a circular linked list.
public void Traverse() {
if (head == null) return;
Node current = [1];
do {
Console.WriteLine(current.[2]);
current = current.[3];
} while (current != head);
}The method starts from head, prints the data of each node, moves to the next node, and stops after completing one full cycle.
