摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). Give 阅读全文
posted @ 2016-03-14 17:19 哥布林工程师 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).   Given binary tree {3,9,20,#,#, 阅读全文
posted @ 2016-03-14 17:10 哥布林工程师 阅读(134) 评论(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. You may comple 阅读全文
posted @ 2016-03-14 16:48 哥布林工程师 阅读(184) 评论(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. You may comple 阅读全文
posted @ 2016-03-14 16:37 哥布林工程师 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2016-03-14 16:31 哥布林工程师 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2016-03-14 15:05 哥布林工程师 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Given n items with size Ai and value Vi, and a backpack with size m. What's the maximum value can you put into the backpack? Given 4 items with size [ 阅读全文
posted @ 2016-03-14 15:00 哥布林工程师 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given n items with size Ai, an integer m denotes the size of a backpack. How full you can fill this backpack? If we have 4 items with size [2, 3, 5, 7 阅读全文
posted @ 2016-03-14 14:48 哥布林工程师 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given an array of strings, return all groups of strings that are anagrams. Given ["lint", "intl", "inlt", "code"], return["lint", "inlt", "intl"]. Giv 阅读全文
posted @ 2016-03-14 14:37 哥布林工程师 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports the following two operations: addWord(word) and search(word) search(word) can search a literal word or a regular 阅读全文
posted @ 2016-03-14 13:51 哥布林工程师 阅读(178) 评论(0) 推荐(0) 编辑