剑指offer
文章平均质量分 62
yoohoosome
这个作者很懒,什么都没留下…
展开
-
[刷题]Space Replacement
[LintCode]Space Replacement public class Solution { /** * @param string: An array of Char * @param length: The true length of the string * @return: The true length of new string原创 2015-07-18 11:10:32 · 551 阅读 · 0 评论 -
[刷题]Fibonacci
[LintCode]Fibonacci class Solution { /** * @param n: an integer * @return an integer f(n) */ HashMap map; public int fibonacci(int n) { // 2015-07-16 // 用哈原创 2015-07-16 09:55:56 · 286 阅读 · 0 评论 -
[刷题]Singleton
[LintCode]Singleton class Solution { /** * @return: The same instance of this class every time */ // 私有静态 private static Solution slt = null; // 私有构造函数 private Solution原创 2015-07-15 09:41:38 · 296 阅读 · 0 评论 -
[刷题]Count 1 in Binary
[LIntCode]Count 1 in Binary public class Solution { /** * @param num: an integer * @return: an integer, the number of ones in num */ public int countOnes(int num) { //原创 2015-07-17 09:43:33 · 353 阅读 · 0 评论 -
[刷题]Find Minimum in Rotated Sorted Array II
[LintCode]Find Minimum in Rotated Sorted Array II public class Solution { /** * @param num: a rotated sorted array * @return: the minimum number in the array */ public int原创 2015-07-20 10:02:04 · 253 阅读 · 0 评论 -
[刷题]Find Minimum in Rotated Sorted Array
[LintCode]Find Minimum in Rotated Sorted Array public class Solution { /** * @param num: a rotated sorted array * @return: the minimum number in the array */ public int findMin原创 2015-07-19 11:30:46 · 320 阅读 · 0 评论 -
[刷题]Construct Binary Tree from Inorder and Postorder Traversal
[LintCode]Construct Binary Tree from Inorder and Postorder Traversal /** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * pu原创 2015-07-23 09:54:41 · 251 阅读 · 0 评论