码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
【leetcode】Search Insert Position
Search Insert PositionGiven 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 ...
分类:其他好文   时间:2015-01-27 00:29:17    阅读次数:129
【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 fir...
分类:其他好文   时间:2015-01-27 00:26:06    阅读次数:204
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)算法思想: 二分法,数组的中间点为根节点,然后递归。 (2)代码如下: {CSDN:CODE:589537}...
分类:其他好文   时间:2015-01-26 19:21:31    阅读次数:136
leetcode 27. 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 for a...
分类:其他好文   时间:2015-01-26 18:56:42    阅读次数:227
Leetcode: Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ...
分类:其他好文   时间:2015-01-26 13:26:51    阅读次数:195
Leetcode: Missing Ranges
Given a sorted integer array where the range of elements are [lower, upper] inclusive, return its missing ranges.For example, given [0, 1, 3, 50, 75],...
分类:其他好文   时间:2015-01-26 11:33:54    阅读次数:185
[Leetcode] Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret...
分类:其他好文   时间:2015-01-26 06:30:30    阅读次数:104
poj1094 拓扑排序
http://poj.org/problem?id=1094 Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to larges...
分类:编程语言   时间:2015-01-25 19:39:31    阅读次数:185
LeetCode | #21 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. 思路: 设置两个头指针,一个指针不动,用来返回最后头结点,一个指针用来组织节点顺序,遍...
分类:其他好文   时间:2015-01-25 18:18:40    阅读次数:203
uva10098 Generating Fast, Sorted Permutation
#include"iostream"#include"stdio.h"#include"string.h"#include"algorithm"#include"stdlib.h"using namespace std;char s[100];int main(){ int t; cin...
分类:其他好文   时间:2015-01-24 22:44:13    阅读次数:212
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!