今際の国の呵呵君
Sunday, January 11, 2015
[LeetCode]Partition List
就是把一个linkedlist分解成两个linkedlist,我们各用两个指针分别track小于x的链表的头尾节点和大于等于x的链表的头尾节点即可。时间复杂度O(N),常数空间,代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment