Trees

56 problems to practice.

56 Total
36 Easy
19 Medium
1 Hard

Add One Row To Tree

1. Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with va...

easy

Cameras In Binary Tree

1. You are given a partially written function to solve. 2. You are required to complete the body of...

easy

House Robber In Binary Tree

1. You are given a partially written function to solve. 2. The thief has found himself a new place...

easy

Longest Zigzag Path In A Binary Tree

1. You are given a partially written function to solve. 2. Given a binary tree root, a ZigZag path...

easy

Validate Bst

1. You are given a partially written function to solve. 2. Determine if it is a valid binary search...

easy

Recover Bst

1. You are given a partially written function to solve(Refer question video). 2. You are given the...

easy

Construct Binarytree From Preorder And Inorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...

easy

Construct Binarytree From Postorder And Inorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...

medium

Construct Bst From Inorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...

easy

Construct Bst From Preorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...

easy

Construct Bst From Postorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...

easy

Construct Bst From Levelorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...

medium

Serialize And Deserialize Binary Tree

1. Serialization is to store tree in a file so that it can be later restored. 2. The structure of t...

easy

Construct Binary Tree From Preorder And Postorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. you will be given...

easy

Left View Of A Binarytree

1. Given a Binary Tree, print left view of it. 2. Left view of a Binary Tree is set of nodes visib...

easy

Right View Of A Binarytree

1. Given a Binary Tree, print Right view of it. 2. Right view of a Binary Tree is set of nodes vis...

easy

Vertical Order Traversal Of A Binarytree

1. Given a Binary Tree, print Vertical Order of it. 2. For more Information watch given video link...

easy

Vertical Order Traversal Of A Binarytree-ii

1. Given a Binary Tree, print Vertical Order of it. 2. For each node at position (row, col), its l...

easy

Width Of Shadow Of Binary Tree

1. Given a Binary Tree, return Width Of Shadow Of A Binary Tree. 2. For more detail watch the vide...

easy

Bottom View Of A Binarytree

1. Given a Binary Tree, print Bottom View of it. 2. For more Information watch given video link be...

easy

Top View Of A Binarytree

1. Given a Binary Tree, print top View of it. 2. For more Information watch given video link below...

easy

Diagonal Order Of A Binarytree

1. Given a Binary Tree, print Diagonal Order of it. 2. For more Information watch given video link...

easy

Diagonal Order (anti-clock Wise) Of A Binarytree

1. Given a Binary Tree, print Diagonal Order of it anti-clock wise. 2. For more Information watch...

easy

Vertical Order Sum Of A Binarytree

1. Given a Binary Tree, print Vertical Order Sum of it. 2. For more Information watch given video...

easy

Diagonal Order Sum Of A Binary Tree

1. Given a Binary Tree, print Diagonal order sum of it. 2. For more Information watch given video...

medium

In Order Morris Traversal In Binarytree

1. Given a Binary Tree, return inorder Traversal of it. 2. For more Information watch given video...

easy

Pre Order Morris Traversal In Binary Tree

1. Given a Binary Tree, return Preorder Traversal of it. 2. For more Information watch given video...

easy

Binary Search Tree Iterator 2

1. Implement the BSTIterator class that represents an iterator over the in-order traversal of a bina...

easy

Node To Root Path Binary Tree

1. Given a Binary Tree, return root To Node path of it. 2. For more Information watch given video...

medium

All Single Child Parent In Binary Tree

1. Given a Binary Tree, return list of all single child parent of binary tree 2. For more Informati...

easy

Count All Single Child Parent In Binary Tree

1. Given a Binary Tree, return count all single child parent of binary tree 2. For more Information...

medium

Convert Binary Search Tree To Doubly Linked List

1. Convert a Binary Search Tree to a sorted Circular Doubly-Linked List in place. 2. The left and r...

medium

Convert Sorted Doubly Linked List To Binary Search Tree

1. Convert a sorted Doubly-Linked List to a Balanced Binary Search Tree in place. 2. The previous a...

medium

Maximum Path Sum In Between Two Leaves Of Binary Tree

1. You are given a partially written function to solve. 2. You are required to complete the body of...

medium

Maximum Path Sum Of Binary Tree

1. You are given a partially written function to solve. 2. You are required to complete the body...

medium

Path Sum In Binary Tree

1. You are given a partially written function to solve. 2. You are required to complete the body of...

easy

Path Sum In Binary Tree - 2

1. You are given a partially written function to solve. 2. You are required to complete the body of...

medium

Diameter Of Binary Tree All Methods

1. You are given a partially written function to solve. 2. You are required to complete the body of...

easy

Serialize And Deserialize N - Ary Tree

1. Serialization is to store tree in a file so that it can be later restored. 2. The structure of t...

medium

All Nodes Distance K In Binary Tree

1. Given the root of a binary tree. 2. The value of a target node target, and an integer k. 3. You...

medium

Construct Binary Tree From Inorder And Levelorder Traversal

1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...

medium

Burning Tree

1. Given a binary tree and target. 2. Find the minimum time required to burn the complete binary t...

medium

Burning Tree 2

1. Given a binary tree and target. 2. Find the minimum time required to burn the complete binary t...

medium

Maximum Width Of Binary Tree

1. Given the root of a binary tree, return the maximum width of the given tree. 2. The maximum widt...

medium

Path Sum Equal To Given Value

1. Given the root of a binary tree and an integer targetSum, return the number of paths where the su...

medium

Lowest Common Ancestor Of A Binary Tree

1. Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. 2. Ac...

medium

Unique Binary Search Trees 2

Given an integer n, return all the structurally unique BST's (binary search trees), which has exactl...

easy

All Possible Full Binary Trees

Given an integer n, return a list of all possible full binary trees with n nodes. Each node of each...

easy

Path In Zigzag Labelled Binary Tree

https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree/

easy

Complete Binary Tree Inserter

https://leetcode.com/problems/complete-binary-tree-inserter/

easy

Delete Nodes And Return Forest

https://leetcode.com/problems/delete-nodes-and-return-forest/#:~:text=Delete%20Nodes%20And%20Return%...

easy

Count Good Nodes In Binary Tree

https://leetcode.com/problems/count-good-nodes-in-binary-tree/

easy

Even Odd Tree

<a href="https://leetcode.com/problems/even-odd-tree/">https://leetcode.com/problems/even-odd-...

easy

Longest Univalue Path

https://leetcode.com/problems/longest-univalue-path/

hard

Populating Next Right Pointers In Each Node

<a href="https://leetcode.com/problems/populating-next-right-pointers-in-each-node/">https://l...

easy

Binary Tree Coloring Game

https://leetcode.com/problems/binary-tree-coloring-game/

medium