摘要: 题目描述: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the sta 阅读全文
posted @ 2016-01-27 22:39 scottwang 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 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 given 阅读全文
posted @ 2016-01-27 21:32 scottwang 阅读(180) 评论(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]. 解题思路: 每次在上一个list前面插入1,然后后面的每两个间相加赋值给前一 阅读全文
posted @ 2016-01-27 21:09 scottwang 阅读(290) 评论(0) 推荐(0) 编辑