摘要: 终于到了二叉树。题目如下: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... 阅读全文
posted @ 2014-11-11 23:45 Tiny-Box 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 第三道还是帕斯卡三角,这个是要求正常输出,题目如下:Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5, Return[ [1], [1,1], ... 阅读全文
posted @ 2014-11-11 09:28 Tiny-Box 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 我是按难度往下刷的,第二道是帕斯卡三角形二。简单易懂,题目如下:Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3, Return [1,3,3,1].Note: Could y... 阅读全文
posted @ 2014-11-11 00:34 Tiny-Box 阅读(129) 评论(0) 推荐(0) 编辑
摘要: leetcode的第一题,回文数判断。原题如下:For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a palindrome.Note: Have you consider that t... 阅读全文
posted @ 2014-11-09 19:06 Tiny-Box 阅读(120) 评论(0) 推荐(0) 编辑