Given the root of a binary tree, return the sum of all left leaves. Number of nodes in the tree lie in the range – [1, 1000]
The lowest common ancestor is defined between two nodes p and q as the lowest node in Tre that has both p and q as descendants.
Given the root of a binary tree, invert the tree, and return its root.
Root to leaf path problem statement is:
Given the root of a binary tree, return all root-to-leaf paths in any order. A leaf is a node with no children.
The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants.
Given the roots of two binary trees p and q, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical, and each identical node has the same value.
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 leaf node.
Note: A leaf is a node with no children.
Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.
Given a Binary tree, print it in vertical order from left to right.
We could solve this problem by performing a breadth-first or level order traversal on the given tree.
In the last post we learnt about Binary Search Trees and basic operations like insert and search on them. In this post we’ll learn about some complex operations on them.