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) 编辑

2015年4月14日

160. Intersection of Two Linked Lists

摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文

posted @ 2015-04-14 11:25 shini 阅读(102) 评论(0) 推荐(0) 编辑

162. Find Peak Element

摘要: A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its index.... 阅读全文

posted @ 2015-04-14 11:09 shini 阅读(107) 评论(0) 推荐(0) 编辑

2015年4月13日

168. Excel Sheet Column Title

摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文

posted @ 2015-04-13 08:37 shini 阅读(93) 评论(0) 推荐(0) 编辑

169. Majority Element

摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文

posted @ 2015-04-13 08:34 shini 阅读(212) 评论(0) 推荐(0) 编辑

导航