A. The loop condition while(temp != NULL) is wrong for circular lists.
B. The break condition is incorrect; it should check temp->next.
C. The loop condition should be do-while, not while.
D. The printf statement should be after updating temp.
Solution
Step 1: Analyze loop condition for circular linked list
In circular linked list, next pointer is never NULL, so while(temp != NULL) will cause infinite loop.
Step 2: Check break condition usage
Break condition temp == head is correct to stop traversal after full cycle.
Final Answer:
The loop condition while(temp != NULL) is wrong for circular lists. -> Option A
Quick Check:
Use do-while or check for start node, not NULL [OK]
Hint: Never check NULL in circular list traversal [OK]
Common Mistakes:
Using while(temp != NULL) causing infinite loop
Incorrect break condition
Printing after moving temp
Confusing linear and circular list traversal
5. You have a circular linked list with nodes containing values 5, 15, 25, 35. You want to print all nodes except the node with value 25 during traversal. Which modification to the traversal code below achieves this?