码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2-...
分类:其他好文   时间:2014-09-18 05:24:13    阅读次数:195
Median of Two Sorted Arrays(Java)
求2个数组的中位数方法很多但是时间复杂度各异1利用数组copy方法先融合两个数组,然后排序,找出中位数import java.lang.reflect.Array;import java.util.Arrays;import java.util.Collection;import java.util...
分类:编程语言   时间:2014-09-18 00:41:02    阅读次数:222
Remove Duplicates from Sorted Array
[leetcode]Remove Duplicates from Sorted Array...
分类:其他好文   时间:2014-09-17 21:54:52    阅读次数:199
Search for a Range <leetcode>
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
分类:其他好文   时间:2014-09-17 13:31:02    阅读次数:144
Leetcode: Insertion Sort List
Sort a linked list using insertion sort.难度:84. 我自己的做法是使用了额外的空间,建立了一个新的sorted的LinkedList, 技巧还是建立一个dummy node做前置节点。 1 /** 2 * Definition for singly-lin....
分类:其他好文   时间:2014-09-17 13:30:42    阅读次数:264
STL algorithm算法is_sorted和is_sorted_until(28)
is_sort的原型: ::is_sorted default (1) template bool is_sorted (ForwardIterator first, ForwardIterator last); custom (2) template bool is_sorted (ForwardIterator fir...
分类:其他好文   时间:2014-09-17 10:17:32    阅读次数:220
LeetCode: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 first two lists.思路:增加一个头指...
分类:其他好文   时间:2014-09-15 22:38:49    阅读次数:217
1057. Stack (30)
/*to solve the problem ,i think we can use stack to maintain the numbers,and list to keep it sorted,which is very important to find the Median number....
分类:其他好文   时间:2014-09-15 19:07:19    阅读次数:181
【LeetCode题目记录-4】插入数组间隔问题
Insert Interval  Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to t...
分类:其他好文   时间:2014-09-15 17:51:09    阅读次数:264
Median of Two Sorted Arrays-LeetCode
题目: There are two sorted arrays A and B of size m and n respectively.Find the Median of two sorted arrays.The overall run time complexity should be O(...
分类:其他好文   时间:2014-09-15 14:19:58    阅读次数:170
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!