随笔分类 -  LeetCode

摘要: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 阅读(225) 评论(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 阅读(173) 评论(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 阅读(118) 评论(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 阅读(100) 评论(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 阅读(348) 评论(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 阅读(93) 评论(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 阅读(93) 评论(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 阅读(133) 评论(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 阅读(116) 评论(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 阅读(178) 评论(0) 推荐(0)
摘要:For a given sorted array (ascending order) and a target number, find the first index of this number in O(log n) time complexity. If the target number 阅读全文
posted @ 2016-12-03 23:08 bubbleStar 阅读(263) 评论(0) 推荐(0)
摘要:题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in t 阅读全文
posted @ 2016-12-01 10:40 bubbleStar 阅读(243) 评论(0) 推荐(0)
摘要:这篇文章总结了该目录下算法题解的分类 二分法 Binary search 基础: binary-search 利用堆栈 150.Evaluate Reverse Polish Notation :http://www.cnblogs.com/bubbleStar/p/6119922.html 20. 阅读全文
posted @ 2016-12-01 10:19 bubbleStar 阅读(276) 评论(0) 推荐(0)
摘要:题目 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or anothe 阅读全文
posted @ 2016-11-30 22:07 bubbleStar 阅读(244) 评论(0) 推荐(0)
摘要:Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文
posted @ 2016-11-15 11:51 bubbleStar 阅读(234) 评论(0) 推荐(0)
摘要:Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2016-11-09 21:19 bubbleStar 阅读(167) 评论(0) 推荐(0)
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2016-11-09 19:59 bubbleStar 阅读(153) 评论(0) 推荐(0)