上一页 1 2 3 4 5 6 ··· 17 下一页

2015年1月23日

摘要: Google面试题股市上一个股票的价格从开市开始是不停的变化的,需要开发一个系统,给定一个股票,它能实时显示从开市到当前时间的这个股票的价格的中位数(中值)。SOLUTION 1:1.维持两个heap,一个是最小堆,一个是最大堆。2.一直使maxHeap的size大于minHeap.3. 当两边si... 阅读全文
posted @ 2015-01-23 08:12 Yu's Garden 阅读(4212) 评论(0) 推荐(0) 编辑

2015年1月20日

摘要: Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the lar... 阅读全文
posted @ 2015-01-20 09:47 Yu's Garden 阅读(5024) 评论(0) 推荐(1) 编辑

2015年1月14日

摘要: PermutationSequence https://oj.leetcode.com/problems/permutation-sequence/The set [1,2,3,…,n] contains a total of n! unique permutations.By listing a... 阅读全文
posted @ 2015-01-14 18:03 Yu's Garden 阅读(1325) 评论(0) 推荐(0) 编辑

2015年1月13日

摘要: Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangemen... 阅读全文
posted @ 2015-01-13 17:58 Yu's Garden 阅读(965) 评论(0) 推荐(0) 编辑

2015年1月8日

摘要: SubsetsGiven a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set mus... 阅读全文
posted @ 2015-01-08 20:05 Yu's Garden 阅读(9911) 评论(1) 推荐(0) 编辑

2015年1月7日

摘要: Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A sol... 阅读全文
posted @ 2015-01-07 14:06 Yu's Garden 阅读(2665) 评论(0) 推荐(0) 编辑

2015年1月5日

摘要: Find Peak ElementA 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 ... 阅读全文
posted @ 2015-01-05 01:55 Yu's Garden 阅读(940) 评论(0) 推荐(0) 编辑

2015年1月4日

摘要: Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must clos... 阅读全文
posted @ 2015-01-04 21:49 Yu's Garden 阅读(653) 评论(0) 推荐(0) 编辑

2015年1月3日

摘要: First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Yo... 阅读全文
posted @ 2015-01-03 22:45 Yu's Garden 阅读(5227) 评论(4) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock IIIQuestion SolutionSay you have an array for which the ith element is the price of a given stock on day i.Design an a... 阅读全文
posted @ 2015-01-03 18:51 Yu's Garden 阅读(791) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 17 下一页

导航