Validate Binary Search Tree (LeetCode 98)
The problem You get the root of a binary tree. Return if it is a valid binary…
Tag
18 posts
The problem You get the root of a binary tree. Return if it is a valid binary…
The problem You get two binary trees, and . Return if contains a node whose…
The problem You get a list of distinct integers. Return every possible subset of…
The problem You get the roots and of two binary trees. Return if they are the…
The problem You get a list of distinct integers. Return every possible ordering…
The problem You get the root of a binary tree and an integer . Return if some…
The problem You get the root of a binary tree (not a BST) and two values and…
The problem You get the root of a binary tree. Return its maximum depth: the…
The problem On an old phone keypad, each digit from 2 to 9 maps to a few letters…
The problem You get the root of a binary tree. Invert it, meaning produce its…
The problem You get the root of a binary tree. Return its diameter: the number…
The problem Given two integers and , return every way to choose distinct…
The problem You get two lists for the same binary tree: its preorder traversal…
The problem You get the root of a binary tree whose values can be negative. A…
Twelve problems that drill backtracking from Lesson 15. They all run the same…
Backtracking is how you systematically explore all possibilities — generate…
If BFS is for levels, DFS is for paths and subtrees — and almost every tree DFS…
Thirteen problems that drill tree DFS from Lesson 13. The skill is recursion…