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
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
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
Day 69 of #100DaysOfCode π
Solved LeetCode 257: Binary Tree Paths β
Used DFS Recursion to build all root-to-leaf paths π³
β± Time: O(nΒ²)
πΎ Space: O(h)
Path building through recursion = simple and elegant π₯
#LeetCode#DSA#Java#BinaryTree#DFS#CodingJourney
Day 14 of #100DaysOfCode π
Today I learned about Binary Trees and how to convert an array into a Binary Tree. π³
β Understood the basic structure of a Binary Tree
β Learned how nodes are connected using left and right child pointers
β Practiced constructing a Binary Tree from an array representation
Slowly building a strong foundation in DSA, one day at a time. πͺ
#100DaysOfCode#DSA#BinaryTree#Cpp#Programming#CodingJourney#SoftwareDevelopment
Day 68 of #100DaysOfCode π
Solved LeetCode 102: Binary Tree Level Order Traversal β
Used BFS Queue to traverse tree level by level π³
β± Time: O(n)
πΎ Space: O(n)
Level-wise traversal done cleanly using queue π₯
#LeetCode#DSA#Java#BinaryTree#BFS#CodingJourney