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
求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
[leetcode]Remove Duplicates from Sorted Array...
分类:
其他好文 时间:
2014-09-17 21:54:52
阅读次数:
199
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
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
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
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
/*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
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
题目: 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