上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 34 下一页

2015年5月6日

Maximum Gap

摘要: Maximum Gap问题:Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/s... 阅读全文

posted @ 2015-05-06 23:33 zhouzhou0615 阅读(111) 评论(0) 推荐(0) 编辑

Count Primes

摘要: Count Primes问题:Count the number of prime numbers less than a non-negative number,n思路: 计算质数的方法:http://en.wikipedia.org/wiki/Prime_number我的代码:public cl... 阅读全文

posted @ 2015-05-06 11:28 zhouzhou0615 阅读(127) 评论(0) 推荐(0) 编辑

Surrounded Regions

摘要: Surrounded Regions问题:Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in t... 阅读全文

posted @ 2015-05-06 10:22 zhouzhou0615 阅读(202) 评论(0) 推荐(0) 编辑

2015年5月5日

Isomorphic Strings

摘要: Isomorphic Strings问题:Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.... 阅读全文

posted @ 2015-05-05 15:04 zhouzhou0615 阅读(168) 评论(0) 推荐(0) 编辑

Reverse Linked List

摘要: Reverse Linked List问题:Reverse a singly linked list.思路: 插入排序的应用我的代码:public class Solution { public ListNode reverseList(ListNode head) { if(... 阅读全文

posted @ 2015-05-05 14:44 zhouzhou0615 阅读(105) 评论(0) 推荐(0) 编辑

2015年4月28日

String to Integer

摘要: String to Integer问题:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please d... 阅读全文

posted @ 2015-04-28 09:44 zhouzhou0615 阅读(148) 评论(0) 推荐(0) 编辑

2015年4月27日

Bitwise AND of Numbers Range

摘要: Bitwise AND of Numbers Range问题:Given a range [m, n] where 0 n || m>= 1; n >>= 1; moveFactor <<= 1; } return m * mo... 阅读全文

posted @ 2015-04-27 21:12 zhouzhou0615 阅读(253) 评论(0) 推荐(0) 编辑

Best Time to Buy and Sell Stock III

摘要: Best Time to Buy and Sell Stock III问题:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find ... 阅读全文

posted @ 2015-04-27 20:35 zhouzhou0615 阅读(130) 评论(0) 推荐(0) 编辑

First Missing Positive

摘要: First Missing Positive问题:Given an unsorted integer array, find the first missing positive integer.思路: A[A[i]] == A[i] 的经典应用我的代码:public class Solution... 阅读全文

posted @ 2015-04-27 18:48 zhouzhou0615 阅读(152) 评论(0) 推荐(0) 编辑

Permutation Sequence

摘要: Permutation Sequence问题:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,思路:假设有n个元素... 阅读全文

posted @ 2015-04-27 15:52 zhouzhou0615 阅读(151) 评论(0) 推荐(0) 编辑

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 34 下一页

导航