![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DFS
Ber03
:)
展开
-
[LeetCode] 797. All Paths From Source to Target
原题链接: https://leetcode.com/problems/all-paths-from-source-to-target/1. 题目介绍Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order....原创 2019-03-27 00:51:48 · 123 阅读 · 0 评论 -
[LeetCode] 938. Range Sum of BST
原题链接: https://leetcode.com/problems/range-sum-of-bst/1. 题目介绍Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive).The binary sear...原创 2019-06-03 20:53:59 · 145 阅读 · 0 评论 -
[LeetCode] 100. Same Tree
原题链接:https://leetcode.com/problems/same-tree/1. 题目介绍Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally i...原创 2019-06-03 02:24:28 · 146 阅读 · 0 评论 -
[LeetCode] 669. Trim a Binary Search Tree
原题链接: https://leetcode.com/problems/trim-a-binary-search-tree/1. 题目介绍Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R...原创 2019-05-24 00:53:21 · 150 阅读 · 0 评论 -
[LeetCode] 965. Univalued Binary Tree
原题链接:https://leetcode.com/problems/univalued-binary-tree/1. 题目介绍A binary tree is univalued if every node in the tree has the same value.Return true if and only if the given tree is univalued.如果一个二...原创 2019-05-22 10:26:26 · 134 阅读 · 0 评论 -
[LeetCode] 700. Search in a Binary Search Tree
原题链接: https://leetcode.com/problems/search-in-a-binary-search-tree/1. 题目介绍Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node’s value eq...原创 2019-05-24 23:31:30 · 173 阅读 · 0 评论 -
[LeetCode] 559. Maximum Depth of N-ary Tree
原题链接:https://leetcode.com/problems/maximum-depth-of-n-ary-tree/1. 题目介绍Given a n-ary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node d...原创 2019-05-16 11:45:01 · 193 阅读 · 0 评论 -
[LeetCode] 404. Sum of Left Leaves
原题链接:https://leetcode.com/problems/sum-of-left-leaves/1. 题目介绍Find the sum of all left leaves in a given binary tree.给出一个二叉树,计算所有左叶子节点的val值之和。Example:There are two left leaves in the binary tree,...原创 2019-05-21 01:24:52 · 138 阅读 · 0 评论 -
[LeetCode] 102. Binary Tree Level Order Traversal
原题链接:https://leetcode.com/problems/binary-tree-level-order-traversal/1. 题目介绍Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).给出一个...原创 2019-05-19 14:31:44 · 171 阅读 · 0 评论 -
[LeetCode] 872. Leaf-Similar Trees
原题链接: https://leetcode.com/problems/leaf-similar-trees/1. 题目介绍Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.将一棵二叉树的全部叶子节...原创 2019-05-09 10:58:50 · 121 阅读 · 0 评论 -
[LeetCode] 46. Permutations
原题链接: https://leetcode.com/problems/permutations/class Solution { public List<List<Integer>> permute(int[] nums) { List<List<Integer>> ans = new ArrayList<>(...原创 2019-05-05 10:54:30 · 88 阅读 · 0 评论 -
[LeetCode] 39. Combination Sum
原题链接: https://leetcode.com/problems/combination-sum/1. 题目介绍Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates...原创 2019-05-04 13:58:53 · 103 阅读 · 0 评论 -
[LeetCode] 430. Flatten a Multilevel Doubly Linked List
原题链接: https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/1. 题目介绍You are given a doubly linked list which in addition to the next and previous pointers, it could have a child point...原创 2019-04-28 12:00:28 · 148 阅读 · 0 评论 -
[LeetCode] 543. Diameter of Binary Tree
原题链接:https://leetcode.com/problems/diameter-of-binary-tree/1. DescriptionGiven a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length ...原创 2019-09-26 23:53:07 · 166 阅读 · 0 评论