随笔分类 - 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
阅读全文
摘要: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,
阅读全文
摘要:Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 题解 该题是求所有可能的排列组合,是一道典型的
阅读全文
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib
阅读全文
摘要:该篇总结了leetcode中 78. Subsets 和 90. Subsets II,主要算法思想是DFS 78. Subsets Given a set of distinct integers, nums, return all possible subsets. Note: The solu
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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],
阅读全文
摘要: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
阅读全文
摘要:Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. 该题是对树做前序遍历 下面分别是递归,非
阅读全文
摘要: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
阅读全文
摘要:题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in t
阅读全文
摘要:这篇文章总结了该目录下算法题解的分类 二分法 Binary search 基础: binary-search 利用堆栈 150.Evaluate Reverse Polish Notation :http://www.cnblogs.com/bubbleStar/p/6119922.html 20.
阅读全文
摘要:题目 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or anothe
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号