上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 28 下一页
摘要: 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-06-05 19:20 TonyLuis 阅读(544) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index... 阅读全文
posted @ 2015-06-05 17:47 TonyLuis 阅读(310) 评论(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: ... 阅读全文
posted @ 2015-06-05 17:19 TonyLuis 阅读(332) 评论(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() -- Remov... 阅读全文
posted @ 2015-06-05 17:04 TonyLuis 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.Th... 阅读全文
posted @ 2015-06-05 16:49 TonyLuis 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.Yo... 阅读全文
posted @ 2015-06-05 16:30 TonyLuis 阅读(204) 评论(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],t... 阅读全文
posted @ 2015-06-05 11:51 TonyLuis 阅读(220) 评论(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".解题思路:本题方法多多,最简单的方式直接按“ ” spil... 阅读全文
posted @ 2015-06-05 10:23 TonyLuis 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another ex... 阅读全文
posted @ 2015-06-05 09:55 TonyLuis 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.解题思路:本题主要需要考虑到斜线的情况,可以分别计算出过points[i]直线最多含几个点,然后算出最... 阅读全文
posted @ 2015-06-04 23:28 TonyLuis 阅读(449) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 28 下一页