Consider the problem of reversing a singly linked list. To take an example, given the linked list below,
the reversed linked list should look like
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
The best algorithm for the problem takes
The best algorithm for the problem takes
It is not possible to reverse a singly linked list in O(1) space.
Answer:(A)
Explanation:
The given linked list is a reverse linked list and the best algorithm in reverse linked list takes
Quiz of this Question
Please comment below if you find anything wrong in the above post