0% found this document useful (0 votes)
16 views3 pages

Coding Blocks Trees Sheet - Kartik Bhaiya Trees Sheet

Uploaded by

slf.ysh31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Coding Blocks Trees Sheet - Kartik Bhaiya Trees Sheet

Uploaded by

slf.ysh31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Getting started with Trees

Merge Two Binary Trees https://leetcode.com/problems/merge-two-binary-trees/


Kth Smallest Element in BST https://leetcode.com/problems/kth-smallest-element-in-a-bst/
All Elements in Two BSTs https://leetcode.com/problems/all-elements-in-two-binary-search-trees/
Delete Node in BST https://leetcode.com/problems/delete-node-in-a-bst/
Trim a BST https://leetcode.com/problems/trim-a-binary-search-tree/
Delete Nodes And Return Forest https://leetcode.com/problems/delete-nodes-and-return-forest/
Path Based Problems
Path Sum 2 https://leetcode.com/problems/path-sum-ii/
Sum root to leaf numbers https://leetcode.com/problems/sum-root-to-leaf-numbers/
Binary Tree maximum sum path https://leetcode.com/problems/binary-tree-maximum-path-sum/
Path Sum 3 https://leetcode.com/problems/path-sum-iii/
Pseudo Palindromic paths in a binary tree https://leetcode.com/problems/pseudo-palindromic-paths-in-a-binary-tree/
Smallest String Starting From Leaf https://leetcode.com/problems/smallest-string-starting-from-leaf/
Insufficient Nodes in Root to Leaf Paths https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths/

LCA
Lowest common ancestor of a binary tree https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
Lowest common ancestor of a deepest leaves https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/
Kth Ancestor of a Tree Node https://leetcode.com/problems/kth-ancestor-of-a-tree-node/

Validate Trees
Validate Binary Tree Nodes https://leetcode.com/problems/validate-binary-tree-nodes/
Validate Binary Search Tree https://leetcode.com/problems/validate-binary-search-tree/
Check Completeness of a Binary Tree https://leetcode.com/problems/check-completeness-of-a-binary-tree/

Algorithms over trees


Maximum Width of Binary Tree https://leetcode.com/problems/maximum-width-of-binary-tree/
Check Completeness of a Binary Tree https://leetcode.com/problems/check-completeness-of-a-binary-tree/
Maximum Difference Between Node and Ancestor https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/
Number of Good Leaf Nodes Pairs https://leetcode.com/problems/number-of-good-leaf-nodes-pairs/
Smallest Subtree with all the Deepest Nodes https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/
All Nodes Distance K in Binary Tree https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/
Vertical Order Traversal of a Binary Tree https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/
Binary Tree Cameras https://leetcode.com/problems/binary-tree-cameras/
Convert Sorted List to Binary Search Tree https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/
Recover Binary Search Tree https://leetcode.com/problems/recover-binary-search-tree/

Serialize and deserialize


Serialize and Deserialize Binary Tree https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
Verify Preorder Serialization of a Binary Tree https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/
Serialize and Deserialize BST https://leetcode.com/problems/serialize-and-deserialize-bst/

Leaf Nodes Based Questions


Deepest Leaves Sum https://leetcode.com/problems/deepest-leaves-sum/
Delete Leaves With a Given Value https://leetcode.com/problems/delete-leaves-with-a-given-value/

Tree Traversals
Smallest Subtree with all the Deepest Nodes https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/
Path In Zigzag Labelled Binary Tree https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree/
Maximum Level Sum of a Binary Tree https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/
Sum of Nodes with Even-Valued Grandparent https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent/
Frog Position After T Seconds https://leetcode.com/problems/frog-position-after-t-seconds/
Even Odd Tree https://leetcode.com/problems/even-odd-tree/
Binary Tree Level Order Traversal https://leetcode.com/problems/binary-tree-level-order-traversal/
Binary Tree Zigzag Level Order Traversal https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/
Binary Tree Level Order Traversal II https://leetcode.com/problems/binary-tree-level-order-traversal-ii/
Binary Tree Right Side View https://leetcode.com/problems/binary-tree-right-side-view/
N-ary Tree Level Order Traversal https://leetcode.com/problems/n-ary-tree-level-order-traversal/
Find Largest Value in Each Tree Row https://leetcode.com/problems/find-largest-value-in-each-tree-row/
Add One Row to Tree https://leetcode.com/problems/add-one-row-to-tree/
Binary Search Tree to Greater Sum Tree https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/
All Elements in Two Binary Search Trees https://leetcode.com/problems/all-elements-in-two-binary-search-trees/
Validate Binary Search Tree https://leetcode.com/problems/validate-binary-search-tree/
Convert BST to Greater Tree https://leetcode.com/problems/convert-bst-to-greater-tree/

Build Trees
All Possible Full Binary Trees https://leetcode.com/problems/all-possible-full-binary-trees/
Construct Binary Search Tree from Preorder Traversal https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/
Recover a Tree From Preorder Traversal https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/
Number Of Ways To Reconstruct A Tree https://leetcode.com/problems/number-of-ways-to-reconstruct-a-tree/
Merge BSTs to Create Single BST https://leetcode.com/problems/merge-bsts-to-create-single-bst/
Unique Binary Search Trees II https://leetcode.com/problems/unique-binary-search-trees-ii/
Convert Sorted List to Binary Search Tree https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/

Nodes Distance
Sum of Distances in Tree https://leetcode.com/problems/sum-of-distances-in-tree/
All Nodes Distance K in Binary Tree https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/

Flip Trees
Flip Equivalent Binary Trees https://leetcode.com/problems/flip-equivalent-binary-trees/
Flip Binary Tree To Match Preorder Traversal https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/

Count based problems


Number of Nodes in the Sub-Tree With the Same Label https://leetcode.com/problems/number-of-nodes-in-the-sub-tree-with-the-same-label/
Unique Binary Search Trees https://leetcode.com/problems/unique-binary-search-trees/

Find kth smallest/largest


Kth Smallest Element in a BST https://leetcode.com/problems/kth-smallest-element-in-a-bst/

You might also like