Link:http://oj.leetcode.com/problems/balanced-binary-tree/Given a binary tree,
determine if it is height-balanced.For this problem, a height-balanced ...
分类:
其他好文 时间:
2014-05-05 22:29:55
阅读次数:
382
1. introductionfrom numpy import
*random.rand(4,4)#array to matrixrandMat=mat(randon.rand(4,4))#matrix
inverseIvrandMat=randMat.I#indentity matrixeye(...
分类:
编程语言 时间:
2014-05-05 22:24:10
阅读次数:
336
Problem Description
Given an positive integer A (1
For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.
Another example...
分类:
其他好文 时间:
2014-05-05 13:22:39
阅读次数:
394
题目:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new len...
分类:
其他好文 时间:
2014-05-05 12:58:57
阅读次数:
294
Input
t – the number of numbers in list, then t lines follow [t
Each line contains one integer: N [0 N
Output
Output given numbers in non decreasing order.
Example
Input:
5
5
3
...
分类:
其他好文 时间:
2014-05-04 00:04:09
阅读次数:
376
Say you have an array for which theithelement
is the price of a given stock on dayi.Design an algorithm to find the maximum
profit. You may complete a...
分类:
其他好文 时间:
2014-05-03 23:21:20
阅读次数:
292
题目:
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (c...
分类:
其他好文 时间:
2014-05-03 21:48:19
阅读次数:
252
EXOCENTER OF A TRIANGLE
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 3209
Accepted: 1259
Description
Given a triangle ABC, the Extriangles of ABC are cons...
分类:
其他好文 时间:
2014-05-03 21:14:28
阅读次数:
340
【题目】
B
Age Sort
Input: Standard Input
Output: Standard Output
You are given the ages (in years) of all people of a country with at least 1 year of age. You kn...
分类:
其他好文 时间:
2014-05-03 16:51:42
阅读次数:
427
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 exa...
分类:
其他好文 时间:
2014-05-03 15:47:53
阅读次数:
289