Computer Sciences > Gate 2022 > Complexity
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,

Which one of the following statements is TRUE about the time complexity of algorithms that solve the above problem in O(1) space?

A
The best algorithm for the problem takes θ(n) time in the worst case.
B
The best algorithm for the problem takes θ( nlog n) time in the worst case.
C
The best algorithm for the problem takes θ(n2) time in the worst case.
D
It is not possible to reverse a singly linked list in O(1) space.

Correct : a

Similar Questions

Consider the following three functions. f1 = 10n f2 = nlogn f3 = n√n Which one of the following options arranges the functions in the increasing order of a...
#810 MCQ
Consider the following three functions. f1 = 10n f2 = nlogn f3 = n√n Which one of the following options arranges the functions in the increasing order of a...
#810 MCQ
Consider the following three functions. f1 = 10n f2 = nlogn f3 = n√n Which one of the following options arranges the functions in the increasing order of a...
#810 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......