码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
第16&17题 Remove Duplicates from Sorted List
Remove Duplicates from Sorted List I 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...
分类:其他好文   时间:2014-10-11 16:50:15    阅读次数:206
第14&15题 Remove Duplicates from Sorted Array I&II
Remove Duplicates from Sorted Array I Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for an...
分类:其他好文   时间:2014-10-11 16:19:56    阅读次数:140
Leetcode:merge_sorted_array
将给定的两个排好序的数组合并成一个有序数组...
分类:其他好文   时间:2014-10-11 03:08:44    阅读次数:134
leetcode 二分查找 Search for a Range
Search for a Range  Total Accepted: 21480 Total Submissions: 78454My Submissions Given a sorted array of integers, find the starting and ending position of a given target value. Your algo...
分类:其他好文   时间:2014-10-11 00:15:07    阅读次数:197
Median of Two Sorted Arrays
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 should be....
分类:其他好文   时间:2014-10-10 23:59:54    阅读次数:226
leetcode 二分查找 Search in Rotated Sorted Array
题意:一个已经排序好的数组,被按某个位置旋转了一次,给定一个值target,在该旋转后的数组里查找该值。 思路:二分查找 难点在于确定往数组的哪一半段继续二分查找 设起点、中间点、终点分别为 start、middle、end (采用前闭后开的区间表示方法 如果target = A[middle] return middle 如果A[middle] >= A[start],则[start,...
分类:其他好文   时间:2014-10-10 23:15:44    阅读次数:219
leetcode 二分查找 Search in Rotated Sorted ArrayII
Search in Rotated Sorted Array II  Total Accepted: 18500 Total Submissions: 59945My Submissions Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this...
分类:其他好文   时间:2014-10-10 21:35:14    阅读次数:239
LeetCode-Remove Duplicates from Sorted Array
题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo...
分类:其他好文   时间:2014-10-10 20:19:34    阅读次数:176
LeetCode Search in Rotated Sorted Array II
Search in Rotated Sorted Array II  Total Accepted: 18488 Total Submissions: 59914My Submissions Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this...
分类:其他好文   时间:2014-10-10 17:26:24    阅读次数:122
Leetcode:convert_sorted_array_to_binary_search_tree
BST的中序遍历是一个sorted-array,再构造回去成一个BST,先将中间的元素作为根节点,这个节点的左右分别是左子树和右子树。如此递归地进行即可。...
分类:其他好文   时间:2014-10-10 02:19:43    阅读次数:173
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!