Given a binary tree, determine if it is
height-balanced.For this problem, a height-balanced binary tree is defined as a
binary tree in which the depth...
分类:
其他好文 时间:
2014-05-19 20:40:55
阅读次数:
278
Question 1:Given an array of integers, find two
numbers such that they add up to a specific target number.The function twoSum
should return indices of...
分类:
其他好文 时间:
2014-05-19 09:35:41
阅读次数:
321
Given a linked list, remove the nth node from
the end of list and return its head.For example,Given linked list:
1->2->3->4->5, and n = 2.After removi...
分类:
其他好文 时间:
2014-05-19 09:16:49
阅读次数:
247
题目描述Given an N*N(N#include#include#includeusing
namespace std;const int maxn=1001;int group[maxn][maxn];bool vis[maxn][maxn];int
dx[4]={0,0,1,-1};int ...
分类:
其他好文 时间:
2014-05-19 09:06:30
阅读次数:
379
Given an array of non-negative integers, you
are initially positioned at the first index of the array.Each element in the
array represents your maximu...
分类:
其他好文 时间:
2014-05-19 08:23:07
阅读次数:
223
Given an array of non-negative integers, you
are initially positioned at the first index of the array.Each element in the
array represents your maximu...
分类:
其他好文 时间:
2014-05-19 08:07:26
阅读次数:
288
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-05-18 20:30:16
阅读次数:
301
Given a triangle, find the minimum path sum
from top to bottom. Each step you may move to adjacent numbers on the row
below.For example, given the fol...
分类:
其他好文 时间:
2014-05-18 02:11:19
阅读次数:
302
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-05-18 01:52:45
阅读次数:
317
Remove Duplicates from Sorted List IGiven a
sorted linked list, delete all duplicates such that each element appear only
once.For example,Given 1->1->...
分类:
其他好文 时间:
2014-05-18 01:41:31
阅读次数:
361