2015年5月20日

摘要: 1 题目Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the... 阅读全文
posted @ 2015-05-20 23:06 聆听V风声 阅读(215) 评论(0) 推荐(0) 编辑

2015年5月7日

摘要: 1 题目Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Hide TagsMathBinary Search2 思路以前没见过,... 阅读全文
posted @ 2015-05-07 16:34 聆听V风声 阅读(117) 评论(0) 推荐(0) 编辑

2015年4月28日

摘要: 堆就是一个完全二叉树,堆要求是指 该节点大于它的两个子节点。而两个字节点大小不一定。堆排序的最坏时间复杂度为nlog(n),平均也为nlog(n),占用空间为o(1),是一种比较排序算法。堆排序也可以用于找最大的k个数。时间复杂度为klog(n),因为建堆后,每次循环实际上都生成一个最大数。下面见代... 阅读全文
posted @ 2015-04-28 10:14 聆听V风声 阅读(195) 评论(0) 推荐(0) 编辑

2015年4月27日

摘要: 1 题目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).You are given a target val... 阅读全文
posted @ 2015-04-27 17:38 聆听V风声 阅读(118) 评论(0) 推荐(0) 编辑

2015年4月22日

摘要: 1 题目Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identica... 阅读全文
posted @ 2015-04-22 21:06 聆听V风声 阅读(130) 评论(0) 推荐(0) 编辑

2015年4月16日

摘要: 1 题目Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter... 阅读全文
posted @ 2015-04-16 17:27 聆听V风声 阅读(138) 评论(0) 推荐(0) 编辑

2015年4月6日

摘要: 1 题目You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sin... 阅读全文
posted @ 2015-04-06 16:36 聆听V风声 阅读(127) 评论(0) 推荐(0) 编辑

2015年4月2日

摘要: 1 题目:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1... 阅读全文
posted @ 2015-04-02 20:41 聆听V风声 阅读(155) 评论(0) 推荐(0) 编辑
 
摘要: 1 题目You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stoppin... 阅读全文
posted @ 2015-04-02 19:51 聆听V风声 阅读(151) 评论(0) 推荐(0) 编辑

2015年3月25日

摘要: 1 题目Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), ret... 阅读全文
posted @ 2015-03-25 21:37 聆听V风声 阅读(138) 评论(1) 推荐(0) 编辑