- Amount of Time for Binary Tree to Be Infected
You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from
- Binary Tree
Types of Binary Trees:
- Binary Tree Maximum Path Sum
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting
- Binary Tree Zigzag Level Order Traversal or Spiral Traversal
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right
- Bottom View
Just remove the check from Top View's answer to ensure we consider the bottommost node at each horizontal level.
- Boundary Order Traversal
You are given a binary tree having 'n' nodes.
- Diameter of a Binary Tree
Given the root of a binary tree, return the length of the diameter of the tree.
- Flatten a binary tree
Given the root of a binary tree, flatten the tree into a "linked list":
- Least Common Ancestor
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
- Path Sum 2
Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values
- Right View
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you c
- Same Tree
Given the roots of two binary trees p and q, write a function to check if they are the same or not.
- Symmetric Trees
Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
- Top View
// Pair class to store node and its horizontal distance
- Two Sum IV Input in BST
Given the root of a binary search tree and an integer k, return true if there exist two elements in the BST such that th
- Types of Binary Trees
Types of Binary Trees:
- is Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.