182 views

3 Answers

4 4 votes

ANs is B,C,D

1 flag:
✌ Low quality (Aparna Bharti “incorrect ans”)
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

Answer:
Position:
Show:

Related questions

6 6 votes
2 2 answers
184
184 views
GO Classes asked Jul 6
184 views
The UNIX editor $\texttt{vi}$ allows searching in both directions, and if the search reaches one end, it wraps around and continues from the other end.If the sequence of ...
6 6 votes
2 2 answers
206
206 views
GO Classes asked Jul 6
206 views
A singly linked list contains $n$ nodes. We want to reverse the order of the elements in the linked list by changing links, not by copying all elements into an array.Whic...
8 8 votes
2 2 answers
202
202 views
GO Classes asked Jul 6
202 views
Consider the following C-style code fragment for reversing a non-empty singly linked list:curr = front; next = curr->next; prev = NULL; while (curr != NULL) { (*) } front...
6 6 votes
3 3 answers
187
187 views
GO Classes asked Jul 8
187 views
A FIFO queue is represented using a circular linked list and only one external pointer $\text{Q}$.Design $1: \text{Q}$ points to the node containing the front item. Desig...