2014年10月26日

摘要: Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, ... 阅读全文
posted @ 2014-10-26 11:16 Yu's Garden 阅读(1213) 评论(0) 推荐(0) 编辑

2014年10月25日

摘要: Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?SOL... 阅读全文
posted @ 2014-10-25 21:08 Yu's Garden 阅读(684) 评论(0) 推荐(1) 编辑
摘要: 8个月从CS菜鸟到拿到Google Offer的经历+内推http://blog.csdn.net/fightforyourdream/article/details/17094127http://www.1point3acres.com/bbs/forum.php?mod=viewthread&t... 阅读全文
posted @ 2014-10-25 19:58 Yu's Garden 阅读(7625) 评论(0) 推荐(1) 编辑

2014年10月24日

摘要: Divide Two IntegersDivide two integers without using multiplication, division and mod operator.SOLUTION 11. 基本思想是不断地减掉除数,直到为0为止。但是这样会太慢。2. 我们可以使用2分法来加... 阅读全文
posted @ 2014-10-24 20:15 Yu's Garden 阅读(3236) 评论(1) 推荐(0) 编辑
摘要: Find Minimum in Rotated Sorted Array II Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-... 阅读全文
posted @ 2014-10-24 19:37 Yu's Garden 阅读(1840) 评论(0) 推荐(0) 编辑
摘要: Find Minimum in Rotated Sorted ArrayQuestion SolutionSuppose a sorted array is rotated at some pivot unknown to youbeforehand.(i.e., 0 1 2 4 5 6 7 mig... 阅读全文
posted @ 2014-10-24 18:37 Yu's Garden 阅读(2553) 评论(0) 推荐(0) 编辑
摘要: CandyThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the followin... 阅读全文
posted @ 2014-10-24 18:08 Yu's Garden 阅读(997) 评论(0) 推荐(0) 编辑
摘要: 引自:http://www.douban.com/note/330562764/注:此分类仅供大概参考,没有精雕细琢。有不同意见欢迎评论~利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.l... 阅读全文
posted @ 2014-10-24 17:46 Yu's Garden 阅读(2163) 评论(1) 推荐(2) 编辑
摘要: Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the ... 阅读全文
posted @ 2014-10-24 16:39 Yu's Garden 阅读(932) 评论(0) 推荐(0) 编辑
摘要: Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ... 阅读全文
posted @ 2014-10-24 12:40 Yu's Garden 阅读(2184) 评论(0) 推荐(1) 编辑

导航