码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
[LeetCode] Search for a Range
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-06-28 19:23:45    阅读次数:200
[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./** * Def...
分类:其他好文   时间:2014-06-21 07:55:42    阅读次数:197
[LeetCode] Remove Duplicates from Sorted List
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-06-21 07:30:11    阅读次数:157
[LeetCode] Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:其他好文   时间:2014-06-21 06:58:22    阅读次数:186
leetcode - Convert Sorted Array to Binary Search Tree
题目:Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.个人思路:1、选...
分类:其他好文   时间:2014-06-21 06:37:00    阅读次数:183
[LeetCode] Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.说明:平衡二叉搜索树,即任何结点的左子树和右子树高度最多相差1的二叉搜索树。二叉搜索树:二叉查找树(Bin...
分类:其他好文   时间:2014-06-21 00:47:08    阅读次数:221
[leetcode] 4. Median of Sorted Arrays
// Question: 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 complexi...
分类:其他好文   时间:2014-06-21 00:22:23    阅读次数:255
[LeetCode] Remove Duplicates from Sorted Array
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...
分类:其他好文   时间:2014-06-20 21:48:33    阅读次数:254
[LeetCode] Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted fr...
分类:其他好文   时间:2014-06-20 15:29:46    阅读次数:233
[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 equa...
分类:其他好文   时间:2014-06-20 15:25:50    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!