🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Linked List Quiz: all 8 questions

Linked List Quiz · Question 8 of 8

Which steps solve "Palindrome Linked List" in O(1) extra space? (select all that apply)

Which steps solve "Palindrome Linked List" in O(1) extra space? (select all that apply)

  1. A.Find the middle with fast & slow pointers
  2. B.Reverse the second half
  3. C.Compare the two halves node by node
  4. D.Copy all values into an array and reverse it
Answer & explanation

Correct answer: Find the middle with fast & slow pointers · Reverse the second half · Compare the two halves node by node

Copying into an array works but uses O(n) space; the three pointer steps need only O(1).

Can you get the rest right without peeking?

Take the timed Linked List Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →