摘要:
Question:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, wher... 阅读全文
posted @ 2015-07-14 18:40
Maydow
阅读(142)
评论(0)
推荐(0)
摘要:
Question:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: ... 阅读全文
posted @ 2015-07-14 15:59
Maydow
阅读(129)
评论(0)
推荐(0)
摘要:
Question: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 fa... 阅读全文
posted @ 2015-07-14 14:54
Maydow
阅读(139)
评论(0)
推荐(0)
摘要:
Question:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root... 阅读全文
posted @ 2015-07-14 14:40
Maydow
阅读(156)
评论(0)
推荐(0)
摘要:
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
阅读(133)
评论(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)