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.这道混合插入有序链...
分类:
其他好文 时间:
2014-11-10 06:27:42
阅读次数:
191
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-11-09 20:51:20
阅读次数:
222
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-11-09 19:30:15
阅读次数:
143
Red is current min. Yellow is sorted list. Blue is current item.(picture from wikipedia, a little too fast)10 numbers. Sort as ascend.1. Find the min ...
分类:
其他好文 时间:
2014-11-09 16:40:27
阅读次数:
225
归并两个有序序列为一个有序序列Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the n...
分类:
其他好文 时间:
2014-11-09 16:34:47
阅读次数:
182
以前做过合并数组,这次是合并链表,写起来很快,第一次提交,忘记new一个listNode的时候传参数,导致编译错误,修改完这个错误后就没问题了,代码因该是很简单的。需要注意的是,凡是sorted的,都是从小到大排列,另外leetcode上面的链表都没有尾巴,便利的时候需要注意。 1 /** 2 *....
分类:
其他好文 时间:
2014-11-09 00:59:17
阅读次数:
164
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.Solution: 1 /** 2 * Definition for binary tree 3 * .....
分类:
其他好文 时间:
2014-11-09 00:58:31
阅读次数:
213
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.Solution: 1 /** 2 * Definition for singl....
分类:
其他好文 时间:
2014-11-09 00:52:30
阅读次数:
316
Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, r...
分类:
其他好文 时间:
2014-11-09 00:49:14
阅读次数:
173
Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that i...
分类:
其他好文 时间:
2014-11-08 16:28:21
阅读次数:
191