码迷,mamicode.com
首页 >  
搜索关键字:elements    ( 4737个结果
HDU - 3117 Fibonacci Numbers
DescriptionThe Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the ...
分类:其他好文   时间:2014-10-07 13:38:23    阅读次数:169
[LeetCode] Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:其他好文   时间:2014-10-07 01:22:02    阅读次数:270
leetcode - Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Could you devis...
分类:其他好文   时间:2014-10-06 18:43:20    阅读次数:201
4Sum_leetCode
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: Elements ...
分类:其他好文   时间:2014-10-05 19:14:28    阅读次数:173
lreplace
Replacing an element of a list with another:% lreplace {a b c d e} 1 1 fooa foo c d eReplacing two elements of a list with three:% lreplace {a b c d e...
分类:其他好文   时间:2014-10-04 13:08:16    阅读次数:162
Subsets
Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets. For example, I...
分类:其他好文   时间:2014-10-03 22:24:55    阅读次数:273
leetcode - Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. /** * Definition for singly-linked list. * struct ListNode { * int val; * Lis...
分类:其他好文   时间:2014-10-03 17:21:45    阅读次数:167
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. /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * ...
分类:其他好文   时间:2014-10-03 15:40:04    阅读次数:186
选择排序---直接选择排序算法(Javascript版)
在要排序的一组数列中,选出最小(或者最大)的一个数与第1个位置的数交换;然后在剩下的数当中再找最小(或者最大)的与第2个位置的数交换,依次类推,直到第n-1个元素(倒数第二个数)和第n个元素(最后一个数)比较为止。function sort(elements){ for(i = 0; i < el....
分类:编程语言   时间:2014-09-30 23:17:30    阅读次数:220
leetcode - Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2, 3...
分类:其他好文   时间:2014-09-30 21:48:20    阅读次数:179
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!