Consider the problem of reversing a singly linked list. For example, the list \(1\rightarrow2\rightarrow3\rightarrow4\rightarrow5\rightarrow6\rightarrow\text{NULL}\) should become \(6\rightarrow5\rightarrow4\rightarrow3\rightarrow2\rightarrow1\rightarrow\text{NULL}\).Which one of the following statements is TRUE about the time complexity of algorithms that solve the above problem in \(O(1)\) space?
- AThe best algorithm for the problem takes \(\theta(n)\) time in the worst case.
- BThe best algorithm for the problem takes \(\theta(n \log n)\) time in the worst case.
- CThe best algorithm for the problem takes \(\theta(n^2)\) time in the worst case.
- DIt is not possible to reverse a singly linked list in O(1) space.