摘要:
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... 阅读全文
posted @ 2015-06-14 17:54
lilixu
阅读(137)
评论(0)
推荐(0)
摘要:
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... 阅读全文
posted @ 2015-06-14 15:53
lilixu
阅读(122)
评论(0)
推荐(0)
摘要:
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2015-06-14 15:25
lilixu
阅读(154)
评论(0)
推荐(0)
摘要:
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le... 阅读全文
posted @ 2015-06-14 15:21
lilixu
阅读(135)
评论(0)
推荐(0)
摘要:
Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No... 阅读全文
posted @ 2015-06-14 15:03
lilixu
阅读(111)
评论(0)
推荐(0)
摘要:
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not... 阅读全文
posted @ 2015-06-14 15:02
lilixu
阅读(130)
评论(0)
推荐(0)
摘要:
Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note... 阅读全文
posted @ 2015-06-14 15:00
lilixu
阅读(132)
评论(0)
推荐(0)
摘要:
Find the seed of a number.Eg : 1716 = 143*1*4*3 =1716 so 143 is the seed of 1716. find all possible seed for a given number.辗转相除法,由性质可利用 sqrt(num) <= ... 阅读全文
posted @ 2015-06-14 14:22
lilixu
阅读(212)
评论(0)
推荐(0)
摘要:
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is read off 阅读全文
posted @ 2015-06-14 13:04
lilixu
阅读(157)
评论(0)
推荐(0)
摘要:
Something cost $10.25 and the customer pays with a $20 bill, the program will print out the most efficient "change-breakdown" which is 1 five, 4 ones,... 阅读全文
posted @ 2015-06-14 12:43
lilixu
阅读(259)
评论(0)
推荐(0)
浙公网安备 33010602011771号