Day 86 of #100DaysOfCode π
Solved LeetCode 1038: Binary Search Tree to Greater Sum Tree β
Used Reverse Inorder Traversal Running Sum to update each BST node with the sum of greater values
β± Time: O(n)
πΎ Space: O(h)
#LeetCode#DSA#Java#BST#BinaryTree#Recursion
Day 84 of #100DaysOfCode π
Solved LeetCode 1382: Balance a Binary Search Tree β
Used Inorder Traversal Divide & Conquer to rebuild a balanced BST π³
β± Time: O(n)
πΎ Space: O(n)
#LeetCode#DSA#BinaryTree#Recursion
Traversal methods in Binary Trees:
β’ Inorder (Left β Root β Right)
β’ Preorder (Root β Left β Right)
β’ Postorder (Left β Right β Root)
Understanding these three traversals is the foundation of tree problems in DSA. π³
#DSA#Coding#CPP#BinaryTree
Day 81 of #100DaysOfCode π
Solved LeetCode 235: Lowest Common Ancestor of a Binary Search Tree β
Used BST properties to locate the split point between two nodes π³
β± Time: O(h)
πΎ Space: O(1)
The first node where paths diverge = LCA π₯
#LeetCode#DSA#Java#BST#BinaryTree
Day 101 β Trees unlocked! π³
β Hierarchical structure with nodes & edges
β Key terms: root, leaf, height, degree, siblings
β Binary Tree
β n nodes = n-1 edges
β Built tree from input using Queue
@rohit_negi9 sir!
#CoderArmy#DSA#Trees#BinaryTree#LearningInPublic
π» DSA Practice β Day 171
Solved 2196 β Create BT From Descriptionsπ³
This was a really interesting BT PB and it definitely one challenges tests the both problem-solving & implementation skillsπ§ π₯
πleetcode.com/u/Anshv8096/#LeetCode#DSA#BinaryTree#ProblemSolvingπ
Day 80 of #100DaysOfCodeπ
Solved LeetCode 701: Insert into a Binary Search Treeβ
Used Recursive BST Insertion to place the new node efficientlyπ³
β± Time: O(h)
πΎ Space: O(h)
Follow BST ordering and insertion becomes naturalπ₯
#LeetCode#DSA#Java#BST#BinaryTree#Recursion
LeetCode 2196 β Create Binary Tree From Descriptions | Day 158
Hash map to store nodes. Track all children. Root = value not a child. Attach left/right accordingly. O(n).
#LeetCode#BinaryTree#Coding
If Binary Trees still confuse you, don't worry.
Every advanced tree problem is built on a few simple concepts.
Master the fundamentals first. The rest becomes much easier. π³
#BinaryTree#DSA#CodingInterview#Programming
Day 71 of #100DaysOfCodeπ
Solved LeetCode 110: Balanced Binary Tree β
Used DFS Recursion β height() returns -1 for unbalanced subtrees π³
β± Time: O(n)
πΎ Space: O(h)
one pass to rule them all!
#LeetCode#DSA#Java#BinaryTree#DFS#CodingJourney