Binary Trees Question List for DSA | Leetcode

Armaan Saini
2 min readMar 15, 2024

--

Let’s talk about binary trees and list of questions that you can do master them on Leetcode. Here’s a comprehensive list I have curated for practice and to learn and revise Binary Trees ( Binary Search Tree included :))

Traversals:

  1. Inorder Traversal
  2. Preorder Traversal
  3. Postorder Traversal
  4. Level Order Traversal
  5. Zigzag Level Order Traversal
  6. N-ary tree Level Order Traversal

Lengths and Depths:

  1. Height of a tree
  2. Diameter of a tree
  3. Balanced Tree
  4. Maximum Width of a binary tree
  5. Maximum Depth of a N-ary tree

Same Trees & Sub Trees & Flip Operations:

  1. Same Tree
  2. Symmetric Tree
  3. Subtree of another tree
  4. Invert Tree
  5. Flip equivalent binary trees
  6. Find duplicate subtrees
  7. Merge two binary trees
  8. Validate BST
  9. Find a corresponding node of a binary tree in the clone tree

Lowest Common Ancestors:

  1. Lowest Common Ancestor of a binary tree
  2. Lowest Common Ancestor of a binary search tree
  3. Lowest Common Ancestor of deepest leaves

Create Tree from arrays:

  1. Create Binary tree from Inorder and Preorder traversal
  2. Create Binary tree from Inorder and Postorder traversal
  3. Create Binary Search tree from a sorted array

Difference in a Binary Trees:

  1. Minimum Absolute Difference in a BST
  2. Minimum distance between BST node
  3. Evaluate Boolean Binary Tree

Camera views of a tree:

  1. Right Side View of Binary Tree
  2. Bottom Left Value in a Binary Tree

Path Sums:

  1. Path Sum
  2. Range Sum in BST
  3. Pseudo-palindromic path in a binary tree
  4. Sum of Root to leaf binary tree
  5. Path Sum III

Flood fills:

  1. Amount of time for the binary tree to be infected
  2. All nodes at a distance K

Insertion/Deletion from a tree:

  1. Binary Tree Pruning
  2. Delete Node in a BST
  3. Insert Node in a BST
  4. Trim a BST

Dynamic Programming:

  1. Unique Binary Search Trees
  2. Unique Binary Search Trees II
  3. House Robber III
  4. All Possible full binary trees

Miscellaneous ( and check your skill in binary tree :)) :

  1. Minimum number of operations to sort a binary tree by level
  2. Cousins in a binary tree
  3. Leaf Similar trees
  4. Construct String from a Binary Tree
  5. Minimum time to collect apples in a binary tree
  6. Check completeness of a binary tree
  7. Time needed to inform all the employees
  8. Count good nodes in a binary tree
  9. Operations on a tree

Cheers. :)

( PS: This list might be incomplete. Will keep updating this post )

--

--