摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2015-02-09 00:07 Vae永Silence 阅读(144) 评论(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".click to show clarification.Cl... 阅读全文
posted @ 2015-02-09 00:06 Vae永Silence 阅读(162) 评论(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-02-09 00:04 Vae永Silence 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 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-02-09 00:02 Vae永Silence 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 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-02-09 00:01 Vae永Silence 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 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-02-08 23:59 Vae永Silence 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 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-02-08 23:57 Vae永Silence 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 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-02-08 23:53 Vae永Silence 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文
posted @ 2015-02-08 23:44 Vae永Silence 阅读(343) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1num2)return 1; } return 0; }}; 阅读全文
posted @ 2015-02-08 23:33 Vae永Silence 阅读(151) 评论(0) 推荐(0) 编辑