码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
[LeetCode]35.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 order. You may assume no duplicates in ...
分类:其他好文   时间:2015-01-24 15:54:49    阅读次数:135
【leetcode】Median of Two Sorted Arrays
Median of Two Sorted ArraysThere are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run...
分类:其他好文   时间:2015-01-24 15:49:37    阅读次数:78
【leetcode】Search for a Range
Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ...
分类:其他好文   时间:2015-01-24 15:46:00    阅读次数:107
【leetcode】Maximum Gap
Maximum GapGiven an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/spac...
分类:其他好文   时间:2015-01-24 15:44:53    阅读次数:201
[LeetCode]34.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 order of O(log n). If the target is...
分类:其他好文   时间:2015-01-24 13:11:16    阅读次数:163
leetcode 【 Search Insert Position 】python 实现
题目: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...
分类:编程语言   时间:2015-01-24 12:58:48    阅读次数:285
二叉搜索树的后序遍历序列
给定一个序列,判断该序列是不是二叉搜索树的后序遍历序列 二叉搜索树定义: 二叉查找树(英语:Binary Search Tree),也称二叉搜索树、有序二叉树(英语:ordered binary tree) ,排序二叉树(英语:sorted binary tree),是指一棵空树或者具有下列性质的二叉树: 1、若任意节点的左子树不空,则左子树上所有结...
分类:其他好文   时间:2015-01-23 23:06:05    阅读次数:220
Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路比较简单,就是每次以中位数为根节点,然后左边即左子树,右边是右子树,递归下去即可超时代码(不知道为啥)...
分类:其他好文   时间:2015-01-23 19:56:34    阅读次数:202
链表经典题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.Hide Tags...
分类:其他好文   时间:2015-01-23 17:53:13    阅读次数:162
POJ 1731 Orders(带重复字母的全排列 + 暴力)
POJ 1731 Orders Description The stores manager has sorted all kinds of goods in an alphabetical order of their labels. All the kinds having labels starting with the same letter are stored ...
分类:其他好文   时间:2015-01-23 16:27:42    阅读次数:176
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!