码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
LeetCode Remove Duplicates from Sorted List
1.题目Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.2.解决方案class Solution { public: ...
分类:其他好文   时间:2015-03-06 19:14:30    阅读次数:133
Merge Two Sorted Lists
Merge Two Sorted Lists问题: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 ...
分类:其他好文   时间:2015-03-06 18:31:18    阅读次数:123
Convert Sorted Array to Binary Search Tree
Convert Sorted Array to Binary Search Tree问题:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路: 递归,....
分类:其他好文   时间:2015-03-06 18:29:42    阅读次数:131
LeetCode Search Insert Position
1.题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array....
分类:其他好文   时间:2015-03-06 17:11:55    阅读次数:109
Leetcode Find Minimum in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m...
分类:其他好文   时间:2015-03-06 12:39:44    阅读次数:173
【桶排序】求无序数组中最大的“Gap"
题目:leetcode Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2...
分类:编程语言   时间:2015-03-06 11:23:28    阅读次数:248
LeetCode -- Merge k Sorted Lists (Divide and Conquer / PriorityQueue)
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 分支策略:每次归并两个已排好序的链表,直至只剩下一个链表。 public class Solution { public ListNode mergeKLists(List list...
分类:其他好文   时间:2015-03-05 19:33:56    阅读次数:138
[LeetCode] 026. Remove Duplicates from Sorted Array (Easy) (C++/Java)
[LeetCode] 026. Remove Duplicates from Sorted Array (Easy) (C++/Java)...
分类:编程语言   时间:2015-03-05 17:03:30    阅读次数:175
Sorting It All Out(topo)
Sorting It All OutTime Limit:1000MSMemory Limit:10000KTotal Submissions:28762Accepted:9964DescriptionAn ascending sorted sequence of distinct values i...
分类:其他好文   时间:2015-03-05 14:16:42    阅读次数:202
[LeetCode] 023. Merge k Sorted Lists (Hard) (C++/Python)
[LeetCode] 023. Merge k Sorted Lists (Hard) (C++/Python)...
分类:编程语言   时间:2015-03-05 13:01:59    阅读次数:186
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!