Merge two sorted linked lists and return it as
a new list. The new list should be made by splicing together the nodes of the
first two lists./***Defin...
分类:
其他好文 时间:
2014-06-04 19:23:45
阅读次数:
243
Given a sorted linked list, delete all
duplicates such that each element appear onlyonce.For
example,Given1->1->2, return1->2.Given1->1->2->3->3,
retu...
分类:
其他好文 时间:
2014-06-04 19:19:16
阅读次数:
205
Reverse 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,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-06-04 18:55:07
阅读次数:
343
Given a linked list and a valuex, partition it
such that all nodes less thanxcome before nodes greater than or equal tox.You
should preserve the origi...
分类:
其他好文 时间:
2014-06-03 14:12:24
阅读次数:
306
Given a binary tree, flatten it to a linked
list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2014-05-30 16:15:02
阅读次数:
224
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-05-30 16:08:05
阅读次数:
238
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-05-30 15:59:56
阅读次数:
249
Sort a linked list inO(nlogn) time using
constant space complexity./** * Definition for singly-linked list. * struct
ListNode { * int val; * L...
分类:
其他好文 时间:
2014-05-30 15:17:18
阅读次数:
312
Sort a linked list using insertion sort./** *
Definition for singly-linked list. * struct ListNode { * int val; * ListNode
*next; * ListNo...
分类:
其他好文 时间:
2014-05-30 15:14:27
阅读次数:
245
A linked list is given such that each node
contains an additional random pointer which could point to any node in the list
or null.Return a deep copy ...
分类:
其他好文 时间:
2014-05-30 15:07:49
阅读次数:
260