摘要: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According 阅读全文
posted @ 2017-05-23 23:50 bubbleStar 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Given 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 order red, 阅读全文
posted @ 2017-05-22 22:08 bubbleStar 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 题解 该题是求所有可能的排列组合,是一道典型的 阅读全文
posted @ 2017-05-21 23:36 bubbleStar 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2017-05-19 16:26 bubbleStar 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 该篇总结了leetcode中 78. Subsets 和 90. Subsets II,主要算法思想是DFS 78. Subsets Given a set of distinct integers, nums, return all possible subsets. Note: The solu 阅读全文
posted @ 2017-05-18 23:31 bubbleStar 阅读(307) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文
posted @ 2017-03-27 23:12 bubbleStar 阅读(74) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1->2 阅读全文
posted @ 2017-03-27 22:26 bubbleStar 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 94. Binary Tree Inorder Traversal Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], 阅读全文
posted @ 2017-01-31 19:44 bubbleStar 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2017-01-31 11:21 bubbleStar 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. 该题是对树做前序遍历 下面分别是递归,非 阅读全文
posted @ 2017-01-29 19:41 bubbleStar 阅读(159) 评论(0) 推荐(0) 编辑