题目:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only cons...
分类:
其他好文 时间:
2014-08-29 13:13:37
阅读次数:
169
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?题目意...
分类:
其他好文 时间:
2014-08-29 12:44:37
阅读次数:
256
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked list. *...
分类:
其他好文 时间:
2014-08-28 19:41:25
阅读次数:
224
题目:
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node fr...
分类:
其他好文 时间:
2014-08-28 18:12:35
阅读次数:
289
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then le...
分类:
其他好文 时间:
2014-08-27 00:20:16
阅读次数:
232
LeetCode: Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 ...
分类:
其他好文 时间:
2014-08-26 22:57:46
阅读次数:
220
Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / ...
分类:
其他好文 时间:
2014-08-26 17:17:06
阅读次数:
133
题目:Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,ret...
分类:
其他好文 时间:
2014-08-26 13:35:46
阅读次数:
223
题目:Partition ListGiven a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should p...
分类:
其他好文 时间:
2014-08-26 13:08:16
阅读次数:
401