Multiple choice technology

Given a linked list, in what complexity can you reverse it.

  1. O(n2)

  2. O(nlgn)

  3. O(n)

  4. O(n3)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Reversing a linked list requires traversing the list once and redirecting each node's next pointer to its predecessor. This is done in a single pass with constant work per node, giving O(n) time complexity.