• 24.9%

https://leetcode.com/problems/reorder-list/#/description

Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…

You must do this in-place without altering the nodes’ values.

49ms, September 22, 2016

https://discuss.leetcode.com/topic/7425/a-concise-o-n-time-o-1-in-place-solution

A concise O(n) time, O(1) in place solution

https://discuss.leetcode.com/topic/4061/my-o-n-c-method-accepted

My O(n) C++ Method, accepted

Firstly, I split the list from the middle into two lists. One from head to middle, and the other from middle to the end. Then we reverse the second list. Finally we merge these two lists. O(n) time complexity and O(1) space complexity.

https://discuss.leetcode.com/topic/10894/share-a-consise-recursive-solution-in-c

Share a consise recursive solution in C++

The recursive idea have been posted by yucheng.wang. Given a example, 1->2->3->4->5, the solution will reorder node(3), then reorder 2 and 4 to have (2->4->3), then 1 and 5 get have 1->5->2->4->3. Each call of reorderList(ListNode* head, int len) will return the last element after this reorderList() call.

https://discuss.leetcode.com/topic/3345/a-python-solution-o-n-time-o-1-space

A python solution O(n) time, O(1) space

https://discuss.leetcode.com/topic/13869/java-solution-with-3-steps

Java solution with 3 steps

This question is a combination of Reverse a linked list I & II. It should be pretty straight forward to do it in 3 steps :)

https://discuss.leetcode.com/topic/18092/java-solution-with-3-steps

Java solution with 3 steps