码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
Remove Duplicates from Sorted List I&&II
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
leetcode--Median of Two Sorted Arrays
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
Search a 2D Matrix
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
神小逻辑 Remove Duplicates from Sorted Array
/*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
基础 sorted array查找最多的一个值.
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
Leetcode:merge_two_sorted_lists
合并两个排好序的链表,按照节点的大小排列。...
分类:其他好文   时间:2014-10-07 00:46:21    阅读次数:192
LeetCode:Merge Two Sorted Lists
题目: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
LeetCode Merge Sorted Array
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
Remove Duplicates from Sorted Array
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
Leetcode:remove_duplicates_from_sorted_list
给定一个排好序的链表,删除所有重复的节点,使每一个节点都只出现一次...
分类:其他好文   时间:2014-10-05 21:17:09    阅读次数:212
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!