2.2.18打乱链表。实现一个分治算法,使用线性对数级别的时间和对数级别的额外空间随机打乱一条链表。
2.2.18
Shuffling a linked list. Develop and implement a divide-and-conquer
algorithmthat randomly shuffles a linked list in linearithmic time and
logarithmic extra space.
参考资料:
http://stackoverflow.com/questions/12167630/algorithm-for-shuffling-a-linked-list-in-n-log-n-time/12168162