Given a singly linked list, rearrange its nodes in a zig-zag fashion such that the nodes alternate between being less than and greater than their adjacent nodes (e.g., L1 < L2 > L3 < L4 > L5...).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.