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-10-08 01:26:44
阅读次数:
239
Problem:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh...
分类:
其他好文 时间:
2014-10-08 00:27:44
阅读次数:
321
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2014-10-07 15:03:53
阅读次数:
130
/*put all vaild new array from the 0 to new length*/public class Solution { public int removeDuplicates(int[] A) { if(A.length < 2) ...
分类:
其他好文 时间:
2014-10-07 06:55:53
阅读次数:
120
int pp = 1; //number of points in the same line of the point i if (k.size()==0){pp=0;} for (int jj=1;jjres){res=pp...
分类:
其他好文 时间:
2014-10-07 05:19:32
阅读次数:
187
题目: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 nodes of the ...
分类:
其他好文 时间:
2014-10-06 18:31:30
阅读次数:
145
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-10-06 13:11:00
阅读次数:
167
class Solution {
public:
int removeDuplicates(int A[], int n) {
int duplicate = 0;
int i = 0;
for(i = 0; i < n - 1; i++){
if(A[i] == A[i + 1]){
dupli...
分类:
其他好文 时间:
2014-10-05 22:23:09
阅读次数:
183
给定一个排好序的链表,删除所有重复的节点,使每一个节点都只出现一次...
分类:
其他好文 时间:
2014-10-05 21:17:09
阅读次数:
212