摘要:
原题链接在这里:https://leetcode.com/problems/shortest-path-with-alternating-colors/ 题目: Consider a directed graph, with nodes labelled 0, 1, ..., n-1. In thi 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/is-graph-bipartite/ 题目: Given an undirected graph, return true if and only if it is bipartite. Recall that a gra 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/find-eventual-safe-states/ 题目: In a directed graph, we start at some node and every turn, walk along a directed 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/partition-array-for-maximum-sum/ 题目: Given an integer array A, you partition the array into (contiguous) subarra 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/keys-and-rooms/ 题目: There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/lexicographically-smallest-equivalent-string/ 题目: Given strings A and B of the same length, we say A[i] and B[i] 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/path-with-maximum-minimum-value/ 题目: Given a matrix of integers A with R rows and C columns, find the maximum sc 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/connecting-cities-with-minimum-cost/ 题目: There are N cities numbered from 1 to N. You are given connections, whe 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/the-earliest-moment-when-everyone-become-friends/ 题目: In a social group, there are N people, with unique integer 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/redundant-connection-ii/ 题目: In this problem, a rooted tree is a directed graph such that, there is exactly one 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/redundant-connection/ 题目: In this problem, a tree is an undirected graph that is connected and has no cycles. Th 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/satisfiability-of-equality-equations/ 题目: Given an array equations of strings that represent relationships betwe 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/regions-cut-by-slashes/ 题目: In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, \, or 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/ 题目: On a 2D plane, we place stones at some integer coordinate point 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/accounts-merge/ 题目: Given a list accounts, each element accounts[i] is a list of strings, where the first elemen 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/network-delay-time/ 题目: There are N network nodes, labelled 1 to N. Given times, a list of travel times as direc 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/ 题目: Given a binary tree rooted at root, the depth of each node is t 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/complete-binary-tree-inserter/ 题目: A complete binary tree is a binary tree in which every level, except possibly 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/split-bst/ 题目: Given a Binary Search Tree (BST) with root node root, and a target value V, split the tree into t 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/check-completeness-of-a-binary-tree/ 题目: Given a binary tree, determine if it is a complete binary tree. Definit 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/ 题目: Given the root of a binary tree, find the maximum value V for 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/ 题目: We are given a binary tree (with root node root), a target node, and an 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/ 题目: Return the root node of a binary search tree that matc 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/ 题目: Given a binary tree with N nodes, each node has a different va 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/add-one-row-to-tree/ 题目: Given the root of a binary tree, then value v and depth d, you need to add a row of nod 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/all-possible-full-binary-trees/ 题目: A full binary tree is a binary tree where each node has exactly 0 or 2 child 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/smallest-string-starting-from-leaf/ 题目: Given the root of a binary tree, each node has a value from 0 to 25 repr 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/distribute-coins-in-binary-tree/ 题目: Given the root of a binary tree with N nodes, each node in the tree has nod 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/binary-tree-pruning/ 题目: We are given the head node root of a binary tree, where additionally every node's value 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/flip-equivalent-binary-trees/ 题目: For a binary tree T, we can define a flip operation as follows: choose any nod 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/ 题目: Convert a BST to a sorted circular doubly-linked li 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/ 题目: Return any binary tree that matches the given p 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/longest-univalue-path/ 题目: Given a binary tree, find the length of the longest path where each node in the path 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree/ 题目: Serialization is the process of converting a data structure or object 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/find-duplicate-subtrees/ 题目: Given a binary tree, return all duplicate subtrees. For each kind of duplicate subt 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/insert-into-a-binary-search-tree/ 题目: Given the root node of a binary search tree (BST) and a value to be insert 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/inorder-successor-in-bst-ii/ 题目: Given a binary search tree and a node in it, find the in-order successor of tha 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/closest-leaf-in-a-binary-tree/ 题目: Given a binary tree where every node has a unique value, and a target key k, 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/equal-tree-partition/ 题目: Given a binary tree with n nodes, your task is to check if it's possible to partition 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/maximum-width-of-binary-tree/ 题目: Given a binary tree, write a function to get the maximum width of the given tr 阅读全文