Top Tweets for #binaryTree
Day - 694
Solved a BST + combinatorics problem today ⚡
Used recursion and combinations to count reorderings that preserve the original BST structure.
#1000DaysOfCode #LeetCode #DSA #Python #BinaryTree

Day - 656
Solved a binary tree problem today ⚡
Used postorder traversal to calculate subtree sums and counts, then checked if each node matched its subtree average.
#1000DaysOfCode #LeetCode #DSA #Python #BinaryTree

Day 44/45 #SDESheetChallenge 🌳
✅ Binary Tree to Doubly Linked List
✅ Find Median in a Data Stream
✅ Kth Largest Element in a Stream
3/3 problems completed. One final day to go! 🚀
@striver_79
@takeUforward_
#DSA #BinaryTree #Heap #Python #LeetCode #ProblemSolving #Coding

Day 37/45 #SDESheetChallenge 🌳
✅ Same Tree
✅ Binary Tree Zigzag Level Order Traversal
✅ Lowest Common Ancestor of a Binary Tree
✅ Boundary Traversal of Binary Tree
@striver_79
@takeUforward_
#DSA #BinaryTree #Python #LeetCode #ProblemSolving #CodingJourney #SDEPreparation

🚀 Day 37 of #SDESheetChallenge
Today's problems focused on advanced Binary Tree traversals and recursive algorithms, covering ancestor queries, structural comparison, and different ways of viewing and traversing a tree.
✅ Lowest Common Ancestor (LCA) in Binary Tree
✅ Check if Two Trees are Identical
✅ Zigzag (Spiral) Level Order Traversal
✅ Boundary Traversal of Binary Tree
Key Learnings
🔹 Lowest Common Ancestor (LCA) in Binary Tree -
Used recursive DFS to locate both target nodes. The first node where one target is found in each subtree becomes the Lowest Common Ancestor.
🔹 Check if Two Trees are Identical -
Applied recursion to compare both the structure and node values of two trees simultaneously, ensuring every corresponding node matches.
🔹 Zigzag (Spiral) Level Order Traversal -
Extended Level Order Traversal (BFS) by alternating the insertion order at each level, producing the required zigzag traversal efficiently.
🔹 Boundary Traversal of Binary Tree -
Solved the problem by dividing it into three parts: traversing the left boundary, collecting all leaf nodes, and traversing the right boundary in reverse order to form the complete boundary.
Takeaway -
Today's problems demonstrated that many Binary Tree questions can be broken down into smaller, well-defined traversals. Whether identifying ancestors, comparing structures, or generating different tree views, combining recursive thinking with systematic traversal patterns leads to clean and efficient solutions.
@takeUforward_ @striver_79
#SDESheetChallenge #DSA #LeetCode #Programming #SoftwareEngineering #ProblemSolving #CodingJourney #DataStructures #Algorithms #BinaryTree #DFS #BFS #JavaScript

Day 36/45 #SDESheetChallenge 🌳
✅ Level Order Traversal
✅ Maximum Depth of Binary Tree
✅ Diameter of Binary Tree
✅ Check for Balanced Binary Tree
4/4 problems completed.
@striver_79
@takeUforward_
#DSA #BinaryTree #Python #LeetCode #CodingJourney #SDEPreparation #Trees

🚀 Day 36 of #SDESheetChallenge
Today's problems focused on fundamental Binary Tree properties, covering level-based traversal and recursive techniques for measuring and validating tree structure.
✅ Level Order Traversal
✅ Maximum Depth of Binary Tree
✅ Diameter of Binary Tree
✅ Check for Balanced Binary Tree
Key Learnings
🔹 Level Order Traversal -
Applied Breadth-First Search (BFS) using a queue to traverse the tree level by level, grouping nodes based on their depth.
🔹 Maximum Depth of Binary Tree -
Used Recursion (DFS) to compute the height of the left and right subtrees, returning the maximum depth by combining their results.
🔹 Diameter of Binary Tree -
Optimized the solution by calculating the height and diameter simultaneously during a single DFS traversal, avoiding repeated height computations.
🔹 Check for Balanced Binary Tree -
Implemented an optimized recursive approach that returns -1 whenever an imbalance is detected, allowing early termination instead of traversing the entire tree unnecessarily.
Takeaway -
Today's problems reinforced that many Binary Tree algorithms are built upon the concept of subtree height. By computing heights intelligently during recursion, multiple properties such as depth, diameter, and balance can be determined efficiently in a single traversal, making recursive thinking an essential skill for tree problems.
@takeUforward_ @striver_79
#SDESheetChallenge #DSA #LeetCode #Programming #SoftwareEngineering #ProblemSolving #CodingJourney #DataStructures #Algorithms #BinaryTree #DFS #BFS #JavaScript

Day 35/45 #SDESheetChallenge 🌳
✅ Preorder, Inorder & Postorder in One Traversal
✅ Vertical Order Traversal
✅ Root to Leaf Paths
✅ Maximum Width of Binary Tree
4/4 problems completed
@striver_79
@takeUforward_
#DSA #BinaryTree #Python #LeetCode #ProblemSolving #CodingJourney

Day 34/45 #SDESheetChallenge 🌳
✅ Morris Preorder Traversal
✅(Right/Left/Bottom/Top )View of Binary Tree
Tree traversals from different perspectives : BFS, DFS, and horizontal distance concepts.
4/4 problems completed.
@striver_79
@takeUforward_
#DSA #BinaryTree #Python

🚀 Day 34 of #SDESheetChallenge
Today's problems continued my journey through Binary Trees, focusing on different ways to visualize a tree and exploring another space-optimized traversal technique.
✅ Morris Preorder Traversal
✅ Right / Left View of Binary Tree
✅ Top View of Binary Tree
✅ Bottom View of Binary Tree
Key Learnings
🔹 Morris Preorder Traversal -
Learned the Morris Traversal technique for preorder traversal, achieving O(n) time and O(1) extra space by temporarily creating and removing threaded links instead of using recursion or a stack.
🔹 Right / Left View of Binary Tree -
Used Depth-First Search (DFS) with level tracking to capture the first node encountered at every level, depending on the traversal order (right-first for right view and left-first for left view).
🔹 Top View of Binary Tree -
Applied Breadth-First Search (BFS) along with horizontal distances to record the first node visible from each vertical line, producing the tree's top view.
🔹 Bottom View of Binary Tree -
Used BFS with horizontal distances while updating the value for each vertical line, ensuring the deepest visible node is retained for the final bottom view.
Takeaway -
Today's problems showed that many Binary Tree view problems are built on the same core ideas - tree traversal and horizontal distance mapping. Choosing the right traversal strategy, whether DFS, BFS, or Morris Traversal, makes it possible to solve these problems efficiently while reinforcing the importance of understanding traversal patterns.
@takeUforward_ @striver_79
#SDESheetChallenge #DSA #LeetCode #Programming #SoftwareEngineering #ProblemSolving #CodingJourney #DataStructures #Algorithms #BinaryTree #TreeTraversal #JavaScript

Day 33/45 #SDESheetChallenge 🌳
✅ Inorder Traversal
✅ Preorder Traversal
✅ Postorder Traversal
✅ Morris Inorder Traversal
Learned Morris Inorder Traversal, which performs in O(n) time & O(1)
4/4 problems completed ✅
@striver_79
@takeUforward_
#DSA #BinaryTree #Python #Day33

Day 159/365 of the DSA grind!
Reusing templates and exploiting BST rules today:
• Level Order Traversal: The standard BFS Queue boilerplate.
• Zigzag Level Order: Same BFS code, just added a boolean flag and Collections.reverse() to flip every other level!
• Minimum Absolute Difference: In-order traversal gives sorted order automatically. Tracked a prev pointer to calculate differences on the fly with O(1) space.
#DSA #Java #100DaysOfCode #LeetCode #BinaryTrees

Day 158/365 of the DSA grind!
Learning the BFS Queue template today!
• Lowest Common Ancestor: If a node gets a hit from both its left and right branches, it's the LCA!
• Right Side View: Level-order traversal. Just grabbed the last node of every level.
• Average of Levels: Same BFS boilerplate, just averaged the level sums!
#DSA #Java #100DaysOfCode #LeetCode #BinaryTrees

Day 157/365 of the DSA grind!
Exploiting tree structures today!
• Binary Tree Max Path Sum (Hard): Used post-order DFS to track global maxes while returning single-path gains.
• BST Iterator: Paused an in-order traversal using a Stack for clean O(h) memory!
• Count Complete Tree Nodes: Skipped the full traversal. Compared left/right depths and used bitwise shifts (1 << height) for an instant count!
#DSA #Java #100DaysOfCode #LeetCode #BinaryTrees

Day 147/365
Solved LeetCode Q2196 today.
Create Binary Tree From Descriptions.
Building parent-child relationships cleanly was the main challenge.
Nice tree construction problem.
#26meDSAkhatam #buildinpublic #LeetCode #binarytree #datastructures

Day 156/365 of the DSA grind!
Passing state through trees today!
• Flatten Binary Tree: Used a reverse post-order traversal (Right, Left, Root) to rewire the tree in O(1) space!
• Path Sum: Subtracted from the target down to the leaves.
• Sum Root to Leaf: Shifted decimals dynamically down the stack (current * 10 + val).
#DSA #Java #100DaysOfCode #LeetCode #BinaryTrees

Day 155/365 of the DSA grind!
Building trees and bending pointers today:
• Construct Tree (Pre/In): Mapped the inorder array to a HashMap for O(1) root lookups to avoid nested loops!
• Construct Tree (In/Post): Same HashMap trick, but working backward from the postorder tail.
• Next Right Pointers II: Banned from using a Queue? Used a Dummy Node to link the next level like a Linked
List instead
#DSA #Java #100DaysOfCode #LeetCode #BinaryTrees

Day 154/365 of the DSA grind!
System design patterns and famous tree problems today:
• LRU Cache: Paired a HashMap with a custom Doubly Linked List for pure O(1) caching!
• Invert Binary Tree: The legendary Google Homebrew problem! Just 3 lines of recursive swapping.
• Symmetric Tree: Mirrored recursion checking outer and inner branches.
#DSA #Java #100DaysOfCode #LeetCode #BinaryTrees

Day 153/365 of the DSA grind!
Hello Binary Trees!
• Partition List: Built two separate dummy lists (one for smalls, one for bigs) and stitched them together.
• Max Depth of Binary Tree: Trees = recursion! Math.max(left, right) + 1.
• Same Tree: Clean recursive structural checks.
#DSA #Java #100DaysOfCode #LeetCode #BinaryTrees

Day 117/365
Solved LeetCode Q226 today.
Invert Binary Tree.
Simple recursion problem, but oddly satisfying to watch the swaps happen.
Classic tree practice.
#26meDSAkhatam #buildinpublic #LeetCode #binarytree #recursion

Day 52 / 100 — Trees
Solved on LeetCode:
• Minimum Absolute Difference in BST
Used inorder traversal to process values in sorted order.
Compared consecutive nodes to get minimum difference.
Classic BST property usage 📌
#100DaysOfCode #LeetCode #DSA #BinaryTree

Day 51 / 100 — Trees
Solved on LeetCode:
• Binary Tree Paths
• Sum of Left Leaves
Used DFS to generate all root-to-leaf paths.
Applied recursion to identify and sum left leaf nodes.
Good recursion + tree traversal practice 🌳
#100DaysOfCode #LeetCode #DSA #BinaryTree

Day 50 / 100 — Trees
Solved on LeetCode:
• Binary Tree Right Side View
Used BFS (level order) and captured the last node of each level.
Gives the visible nodes from the right side.
Nice traversal practice ⚡
#100DaysOfCode #LeetCode #DSA #BinaryTree

Day 49 / 100 — Trees
Solved on LeetCode:
• Construct Binary Tree (Preorder + Inorder)
• Sum Root to Leaf Numbers
Used hashmap + recursion to build tree efficiently.
Applied DFS to compute root-to-leaf sums.
Nice recursion practice 🔁
#100DaysOfCode #LeetCode #DSA #BinaryTree

Day 47 / 100 — Trees
Solved on LeetCode:
• Validate Binary Search Tree
• Flatten Binary Tree to Linked List
Used recursion with bounds for BST validation.
Flattened tree using DFS (in-place transformation).
#100DaysOfCode #LeetCode #DSA #BinaryTree

Day 46 / 100 — Trees (Diameter of Binary Tree)
Solved on LeetCode:
• Diameter of Binary Tree
Used DFS to compute height and update diameter.
Key idea: left height + right height
Single-pass recursion ⚡
#100DaysOfCode #LeetCode #DSA #BinaryTree

Day 100 🥳✅ – Adv Interview Questions
• Vertical Order Traversal using BFS + TreeMap
• column + row based sorting logic
• Cracked Word Ladder using BFS + HashSet optimization
3 LeetCode: 987(Hard), 127(Hard), 696
#100DaysOfCode #DSA #LeetCode #Java #BinaryTree #BuildInPublic

Day 99 ✅– Advanced DSA Practice
• Sqrt Decomposition for range queries
• Block building + optimized query logic
• Built tree from preorder + inorder
• Used HashMap for O(1) index lookup
LeetCode: 693(Daily), 105
#100DaysOfCode #DSA #LeetCode #Java #BinaryTree #BuildInPublic

Day 99 ✅– Advanced DSA Practice
• Sqrt Decomposition for range queries
• Block building + optimized query logic
• Built tree from preorder + inorder
• Used HashMap for O(1) index lookup
LeetCode: 693(Daily), 105
#100DaysOfCode #DSA #LeetCode #Java #BinaryTree #BuildInPublic

Day 98 ✅ – Range Queries Practice
• Practiced bit manipulation + range-style enumeration
• Strengthened binary operations and bit counting logic
• Solved LED/time using brute + optimization
LeetCode: 190, 401
#100DaysOfCode #DSA #LeetCode #Java #BitManipulation #BuildInPublic

Trends for you
Most Popular Users

Elon Musk 
@elonmusk
239.8M followers

Barack Obama 
@barackobama
118.6M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92.1M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.7M followers

X 
@x
60.6M followers
































































