上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 30 下一页
摘要: Question:Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary t... 阅读全文
posted @ 2015-10-05 10:27 江湖小妞 阅读(162) 评论(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-10-04 20:32 江湖小妞 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Question:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from i... 阅读全文
posted @ 2015-09-30 11:19 江湖小妞 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Queue接口与List、Set同一级别,都是继承了Collection接口。LinkedList实现了Queue接 口。Queue接口窄化了对LinkedList的方法的访问权限(即在方法中的参数类型如果是Queue时,就完全只能访问Queue接口所定义的方法 了,而不能直接访问 LinkedLi... 阅读全文
posted @ 2015-09-30 11:03 江湖小妞 阅读(506) 评论(0) 推荐(0) 编辑
摘要: Question:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from i... 阅读全文
posted @ 2015-09-30 10:38 江湖小妞 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Question:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can ... 阅读全文
posted @ 2015-09-29 14:48 江湖小妞 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Question:Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths ... 阅读全文
posted @ 2015-09-28 16:27 江湖小妞 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Question:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspir... 阅读全文
posted @ 2015-09-26 23:13 江湖小妞 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Question:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ide... 阅读全文
posted @ 2015-09-23 19:01 江湖小妞 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Question:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is ... 阅读全文
posted @ 2015-09-23 14:39 江湖小妞 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 30 下一页