Min Li's Note
KVM,QEMU, X86 virtualization
Pages
Home
Collection
About
Saturday, September 20, 2014
Sort List
Problem
Sort a linked list in O(n log n) time using constant space complexity.
Idea
Use merge sort ideas to solve. Use two pointer to find the mid position of list. And sort the left and right recursively. Then merge them together.
Solution
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment