码迷,mamicode.com
首页 >  
搜索关键字:elements    ( 4737个结果
LeetCode——Spiral Matrix
Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],...
分类:其他好文   时间:2015-02-05 10:53:08    阅读次数:131
LeetCode[Sort]: 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 if the array contains less than 2 elements. ...
分类:其他好文   时间:2015-02-05 09:38:18    阅读次数:271
[LeetCode]59.Spiral Matrix II
【题目】 Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the following matrix: [ [ 1, 2, 3 ], [ 8,...
分类:其他好文   时间:2015-02-04 23:29:21    阅读次数:236
4Sum
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: Element...
分类:其他好文   时间:2015-02-04 18:44:19    阅读次数:127
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 ...
分类:其他好文   时间:2015-02-04 18:03:07    阅读次数:163
3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet (a,b,c...
分类:其他好文   时间:2015-02-04 14:46:28    阅读次数:151
leetcode.18--------------4Sum
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: Element...
分类:其他好文   时间:2015-02-04 09:34:11    阅读次数:193
02-1 Reversing Linked List (PAT)
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6,...
分类:其他好文   时间:2015-02-03 22:44:12    阅读次数:236
leetcode.15-----------3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet (a,b,c...
分类:其他好文   时间:2015-02-03 09:35:05    阅读次数:134
108.Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it toa height balanced BST. HideTags  Tree  Depth-first Search #pragma once #include #include using namespace std;...
分类:其他好文   时间:2015-02-02 23:14:33    阅读次数:181
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!