摘要:
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
树獭君
阅读(248)
评论(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
树獭君
阅读(141)
评论(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
树獭君
阅读(165)
评论(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
树獭君
阅读(145)
评论(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
树獭君
阅读(189)
评论(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
树獭君
阅读(250)
评论(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
树獭君
阅读(170)
评论(0)
推荐(0)

浙公网安备 33010602011771号