摘要:
Question: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 ... 阅读全文
posted @ 2015-07-14 13:39
Maydow
阅读(132)
评论(0)
推荐(0)
摘要:
Question: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 n... 阅读全文
posted @ 2015-07-14 13:10
Maydow
阅读(118)
评论(0)
推荐(0)
摘要:
Question:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the giv... 阅读全文
posted @ 2015-07-14 11:45
Maydow
阅读(129)
评论(0)
推荐(0)
摘要:
Question:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1... 阅读全文
posted @ 2015-07-14 11:11
Maydow
阅读(146)
评论(0)
推荐(0)
摘要:
Question:Given an indexk, return thekthrow of the Pascal's triangle. For example, givenk= 3, Return[1,3,3,1].1、题型分类:2、思路:直接使用公式,第n行 第0个数是1,从第i个数开始一次... 阅读全文
posted @ 2015-07-14 10:53
Maydow
阅读(144)
评论(0)
推荐(0)
摘要:
Question:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a ca... 阅读全文
posted @ 2015-07-14 09:25
Maydow
阅读(123)
评论(0)
推荐(0)
摘要:
Question:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -... 阅读全文
posted @ 2015-07-14 08:55
Maydow
阅读(156)
评论(0)
推荐(0)