上一页 1 2 3 4 5 6 ··· 51 下一页
2015年4月30日
摘要: Count Primes2015.4.30 15:51Count the number of prime numbers less than a non-negative number,nSolution: Sieve of Eratosthenes.Accepted code: 1 // 2CE... 阅读全文
posted @ 2015-04-30 15:53 zhuli19901106 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Remove Linked List Elements2015.4.30 15:00Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4... 阅读全文
posted @ 2015-04-30 15:04 zhuli19901106 阅读(412) 评论(0) 推荐(0) 编辑
2015年4月22日
摘要: Happy Number2015.4.22 12:39Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Startin... 阅读全文
posted @ 2015-04-22 12:43 zhuli19901106 阅读(420) 评论(0) 推荐(0) 编辑
2015年4月17日
摘要: Bitwise AND of Numbers Range2015.4.17 06:30Given a range [m, n] where 0 m) { 6 n = (n & n - 1); 7 } 8 return m & n; 9 ... 阅读全文
posted @ 2015-04-17 06:32 zhuli19901106 阅读(391) 评论(0) 推荐(0) 编辑
摘要: Number of Islands2015.4.17 06:16Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and i... 阅读全文
posted @ 2015-04-17 06:22 zhuli19901106 阅读(336) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Right Side View2015.4.17 06:04Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can... 阅读全文
posted @ 2015-04-17 06:07 zhuli19901106 阅读(345) 评论(0) 推荐(0) 编辑
摘要: House Robber2015.4.17 05:52You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the ... 阅读全文
posted @ 2015-04-17 05:56 zhuli19901106 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Number of 1 Bits2015.4.17 05:48Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming wei... 阅读全文
posted @ 2015-04-17 05:50 zhuli19901106 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Reverse Bits2015.4.17 05:42Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as000000101001010... 阅读全文
posted @ 2015-04-17 05:45 zhuli19901106 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Rotate Array2015.4.17 05:37Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,... 阅读全文
posted @ 2015-04-17 05:40 zhuli19901106 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 51 下一页