摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2015-07-06 22:39 穆穆兔兔 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the... 阅读全文
posted @ 2015-07-06 18:08 穆穆兔兔 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C prog... 阅读全文
posted @ 2015-07-06 17:36 穆穆兔兔 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2015-07-06 16:14 穆穆兔兔 阅读(200) 评论(0) 推荐(0) 编辑
摘要: PlaceHolder 阅读全文
posted @ 2015-07-06 15:36 穆穆兔兔 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's tota... 阅读全文
posted @ 2015-07-06 15:32 穆穆兔兔 阅读(279) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two.Credits:Special thanks to@jianchao.li.fighterfor adding this problem and creat... 阅读全文
posted @ 2015-07-06 14:43 穆穆兔兔 阅读(184) 评论(0) 推荐(0) 编辑