Swap the nodes of a singly linked list pairwise (1,2,3,4 becomes 2,1,4,3), by changing links rather than values. Then generalise to reverse each group of k consecutive nodes; a final group shorter…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.