上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页
摘要: QuestionGiven an Iterator class interface with methods:next()andhasNext(), design and implement a PeekingIterator that support thepeek()operation -- i... 阅读全文
posted @ 2015-10-08 10:45 树獭君 阅读(243) 评论(0) 推荐(0) 编辑
摘要: QuestionImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return ... 阅读全文
posted @ 2015-10-08 09:55 树獭君 阅读(137) 评论(0) 推荐(0) 编辑
摘要: QuetionInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Solution 1 -- RecursionEasy to t... 阅读全文
posted @ 2015-10-08 09:06 树獭君 阅读(155) 评论(0) 推荐(0) 编辑
摘要: QuestionDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() --... 阅读全文
posted @ 2015-10-08 08:23 树獭君 阅读(138) 评论(0) 推荐(0) 编辑
摘要: QuestionGivennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after ra... 阅读全文
posted @ 2015-10-08 07:42 树獭君 阅读(183) 评论(0) 推荐(0) 编辑
摘要: QuestionThere areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the followi... 阅读全文
posted @ 2015-10-08 05:30 树獭君 阅读(238) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents you... 阅读全文
posted @ 2015-10-08 00:44 树獭君 阅读(152) 评论(0) 推荐(0) 编辑
摘要: A small coding test that I encountered today.QuestionUsing only primitive types, implement a fixed-size hash map that associates string keys with arbi... 阅读全文
posted @ 2015-10-07 23:41 树獭君 阅读(320) 评论(0) 推荐(0) 编辑
摘要: ProblemThere areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it cos... 阅读全文
posted @ 2015-10-07 09:45 树獭君 阅读(192) 评论(0) 推荐(0) 编辑
摘要: (referrence: GeekforGeeks)Bucket sort is mainly useful when input is uniformly distributed over a range. For example, consider the following problem.S... 阅读全文
posted @ 2015-10-07 06:17 树獭君 阅读(345) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页