2015年4月15日

150. Evaluate Reverse Polish Notation

摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文

posted @ 2015-04-15 02:53 shini 阅读(68) 评论(0) 推荐(0) 编辑

151. Reverse Words in a String

摘要: 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-04-15 02:42 shini 阅读(93) 评论(0) 推荐(0) 编辑

152. Maximum Product Subarray

摘要: 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-04-15 02:22 shini 阅读(104) 评论(0) 推荐(0) 编辑

153. Find Minimum in Rotated Sorted Array

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文

posted @ 2015-04-15 02:03 shini 阅读(89) 评论(0) 推荐(0) 编辑

154. Find Minimum in Rotated Sorted Array II

摘要: Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort... 阅读全文

posted @ 2015-04-15 02:01 shini 阅读(95) 评论(0) 推荐(0) 编辑

155. Min Stack

摘要: 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-04-15 01:45 shini 阅读(119) 评论(0) 推荐(0) 编辑

导航