摘要: You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ... 阅读全文
posted @ 2012-11-06 17:13 程序员杰诺斯 阅读(71) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the... 阅读全文
posted @ 2012-11-06 16:09 程序员杰诺斯 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from lea... 阅读全文
posted @ 2012-11-06 15:58 程序员杰诺斯 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given... 阅读全文
posted @ 2012-11-06 15:30 程序员杰诺斯 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / ... 阅读全文
posted @ 2012-11-06 12:01 程序员杰诺斯 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit.... 阅读全文
posted @ 2012-11-06 11:07 程序员杰诺斯 阅读(91) 评论(0) 推荐(0) 编辑