6 6 votes A circular linked list has $n$ nodes. A function prints every node exactly once and stops when it reaches the starting node again.What is the running time of printing the circular linked list?$O(1)$ $O(n)$ $O(n^2)$ $O(2^n)$ Data Structures goclasses goclasses-cs-dpp goclasses-cs-dpp-day-315 data-structures goclasses-ds-practice-questions circular-linked-list + – GO Classes 182 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
4 4 votes ANs is B,C,D Vraj884 answered Jul 8 1 flag: ✌ Low quality (Aparna Bharti “incorrect ans”) Vraj884 comment Share Follow 0 reply Please log in or register to add a comment.
1 1 vote Even though the list is circular, printing all nodes once still requires visiting each node exactly one time.So the running time is $O(n)$.Answer : B GO Classes answered Jul 6 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Each node needs to be printed once and there are N nodes. $O(N)$ Answer: B Meticulous_March answered Jul 6 Meticulous_March comment Share Follow 0 reply Please log in or register to add a comment.