摘要: Search a 2D MatrixApr 7 '12Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each row is greater than the last integer of the previous row.For example,Consider th 阅读全文
posted @ 2013-02-26 09:03 西施豆腐渣 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Path SumOct 14 '12Given 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 given sum.For example:Given the below binary tree andsum = 22, 5 / \ 4 8 / / \ 11... 阅读全文
posted @ 2013-02-26 05:59 西施豆腐渣 阅读(168) 评论(0) 推荐(0) 编辑