Trees
56 problems to practice.
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...
Cameras In Binary Tree
1. You are given a partially written function to solve. 2. You are required to complete the body of...
House Robber In Binary Tree
1. You are given a partially written function to solve. 2. The thief has found himself a new place...
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...
Validate Bst
1. You are given a partially written function to solve. 2. Determine if it is a valid binary search...
Recover Bst
1. You are given a partially written function to solve(Refer question video). 2. You are given the...
Construct Binarytree From Preorder And Inorder Traversal
1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...
Construct Binarytree From Postorder And Inorder Traversal
1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...
Construct Bst From Inorder Traversal
1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...
Construct Bst From Preorder Traversal
1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...
Construct Bst From Postorder Traversal
1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...
Construct Bst From Levelorder Traversal
1. You are given a partially written function to solve(Refer question video). 2. Task : Construct B...
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...
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...
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...
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...
Vertical Order Traversal Of A Binarytree
1. Given a Binary Tree, print Vertical Order of it. 2. For more Information watch given video link...
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...
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...
Bottom View Of A Binarytree
1. Given a Binary Tree, print Bottom View of it. 2. For more Information watch given video link be...
Top View Of A Binarytree
1. Given a Binary Tree, print top View of it. 2. For more Information watch given video link below...
Diagonal Order Of A Binarytree
1. Given a Binary Tree, print Diagonal Order of it. 2. For more Information watch given video link...
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...
Vertical Order Sum Of A Binarytree
1. Given a Binary Tree, print Vertical Order Sum of it. 2. For more Information watch given video...
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...
In Order Morris Traversal In Binarytree
1. Given a Binary Tree, return inorder Traversal of it. 2. For more Information watch given video...
Pre Order Morris Traversal In Binary Tree
1. Given a Binary Tree, return Preorder Traversal of it. 2. For more Information watch given video...
Binary Search Tree Iterator 2
1. Implement the BSTIterator class that represents an iterator over the in-order traversal of a bina...
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...
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...
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...
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...
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...
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...
Maximum Path Sum Of Binary Tree
1. You are given a partially written function to solve. 2. You are required to complete the body...
Path Sum In Binary Tree
1. You are given a partially written function to solve. 2. You are required to complete the body of...
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...
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...
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...
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...
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...
Burning Tree
1. Given a binary tree and target. 2. Find the minimum time required to burn the complete binary t...
Burning Tree 2
1. Given a binary tree and target. 2. Find the minimum time required to burn the complete binary t...
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...
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...
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...
Unique Binary Search Trees 2
Given an integer n, return all the structurally unique BST's (binary search trees), which has exactl...
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...
Path In Zigzag Labelled Binary Tree
https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree/
Complete Binary Tree Inserter
https://leetcode.com/problems/complete-binary-tree-inserter/
Delete Nodes And Return Forest
https://leetcode.com/problems/delete-nodes-and-return-forest/#:~:text=Delete%20Nodes%20And%20Return%...
Count Good Nodes In Binary Tree
https://leetcode.com/problems/count-good-nodes-in-binary-tree/
Even Odd Tree
<a href="https://leetcode.com/problems/even-odd-tree/">https://leetcode.com/problems/even-odd-...
Longest Univalue Path
https://leetcode.com/problems/longest-univalue-path/
Populating Next Right Pointers In Each Node
<a href="https://leetcode.com/problems/populating-next-right-pointers-in-each-node/">https://l...
Binary Tree Coloring Game
https://leetcode.com/problems/binary-tree-coloring-game/