🚀 𝗗𝗮𝘆 𝟭𝟳/𝟯𝟬 — 𝗗𝗦𝗔 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲 Day 17 and I’ve officially entered tree territory 🌳 Binary trees feel very different from arrays and linked lists. Instead of moving linearly, the thinking branches out in multiple directions. It forces a shift from step-by-step logic to structured, recursive reasoning. Today was about getting comfortable with traversal patterns and trusting recursion a little more. 🔎 𝗗𝗮𝘆 𝟭𝟳 𝗙𝗼𝗰𝘂𝘀 • Practicing tree traversal techniques • Strengthening recursive problem solving • Solved: ✅ Maximum Depth of Binary Tree ✅ Invert Binary Tree ✅ Same Tree Recursion can look intimidating at first, but once the base case is clear, everything starts to feel surprisingly structured. Still building pattern recognition — one node at a time. On to Day 18 #DSA #Python #LeetCode #Consistency #SoftwareEngineering #ProblemSolving
Mastering Binary Tree Traversal and Recursion
More Relevant Posts
-
🚀 𝗗𝗮𝘆 𝟮𝟯/𝟯𝟬 — 𝗗𝗦𝗔 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲 Day 23 and continuing deeper into graph problems. The interesting part about graphs is how many real-world systems they represent — networks, dependencies, routes, and connections. Problems start to feel more like exploring a map than just working through a list. Today’s focus was on using traversal techniques to explore nodes and understand relationships between them. 🔎 𝗗𝗮𝘆 𝟮𝟯 𝗙𝗼𝗰𝘂𝘀 • Strengthening DFS and BFS traversal • Understanding how to track visited nodes • Solved: ✅ Clone Graph ✅ Course Schedule ✅ Rotting Oranges Graph problems definitely require careful thinking, but it’s satisfying when the traversal logic finally clicks. On to Day 24 #DSA #Python #LeetCode #Consistency #SoftwareEngineering #ProblemSolving
To view or add a comment, sign in
-
🚀 𝗗𝗮𝘆 𝟮𝟮/𝟯𝟬 — 𝗗𝗦𝗔 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲 Day 22 and today’s focus moved into graph problems. Graphs introduce a different way of thinking — instead of linear structures, it’s all about exploring connections between nodes. Traversal techniques like DFS and BFS start to play a big role here. Today was about understanding how to navigate through connected components and explore all possible paths systematically. 🔎 𝗗𝗮𝘆 𝟮𝟮 𝗙𝗼𝗰𝘂𝘀 • Understanding graph traversal concepts • Practicing DFS/BFS thinking • Solved: ✅ Number of Islands ✅ Flood Fill ✅ Find if Path Exists in Graph Graph problems can look intimidating at first, but once the traversal pattern becomes clear, the logic starts falling into place. Still learning. Still improving. On to Day 23 #DSA #Python #LeetCode #Consistency #SoftwareEngineering #ProblemSolving
To view or add a comment, sign in
-
🚀 𝗗𝗮𝘆 𝟭𝟴/𝟯𝟬 — 𝗗𝗦𝗔 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲 Day 18, and tree problems are starting to feel a little more familiar. What felt confusing a few days ago is slowly turning into recognizable patterns. Traversals, recursion, and understanding how nodes connect are becoming much clearer with practice. Today’s focus was on exploring different tree traversal approaches and understanding how structure impacts problem solving. 🔎 𝗗𝗮𝘆 𝟭𝟴 𝗙𝗼𝗰𝘂𝘀 • Practicing tree traversal techniques • Strengthening recursive reasoning • Solved: ✅ Binary Tree Inorder Traversal ✅ Binary Tree Level Order Traversal ✅ Balanced Binary Tree It’s interesting how something that initially looks complex starts feeling manageable once the patterns become familiar. Still learning. Still improving. On to Day 19 #DSA #Python #LeetCode #SoftwareEngineering #ProblemSolving
To view or add a comment, sign in
-
𝗢𝗢𝗣𝗦 𝘄𝗮𝘀 𝗼𝗻𝗲 𝗼𝗳 𝘁𝗵𝗼𝘀𝗲 𝘁𝗼𝗽𝗶𝗰𝘀 𝗜 𝗸𝗲𝗽𝘁 𝗿𝗲𝘃𝗶𝘀𝗶𝘁𝗶𝗻𝗴 — 𝗻𝗼𝘁 𝗯𝗲𝗰𝗮𝘂𝘀𝗲 𝗜 𝗳𝗼𝗿𝗴𝗼𝘁 𝗶𝘁, 𝗯𝘂𝘁 𝗯𝗲𝗰𝗮𝘂𝘀𝗲 𝗜 𝗻𝗲𝘃𝗲𝗿 𝗳𝘂𝗹𝗹𝘆 𝘁𝗿𝘂𝘀𝘁𝗲𝗱 𝗺𝘆 𝘂𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗼𝗳 𝗶𝘁. Read about it from multiple sources. Understood the syntax, could follow the examples. But the mental model was always shaky. College lectures sorted that — not by covering something new, but by connecting things in the right order. Inheritance types, method resolution, how one class builds on another — it started making structural sense rather than just syntactic sense. Revisited it all. Coded through single, multi-level, hierarchical, and hybrid inheritance. And for the first time it felt like I actually owned the concept, not just recognized it. #Python #OOP #CS #DataScience
To view or add a comment, sign in
-
-
LeetCode 23: Merge k sorted list: You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it. Approach: Simple and straightforward, iterate through each of the linked-list in the given list, push each node's value into a priority queue using heapq module, create a new linked-list using the elements of priority queue. Time complexity: O(n logn) where n is the total number of values. Space complexity: O(n) #Python #LeetCode #DSA #CompetitiveProgramming #DataStructures #Algorithms #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 57 of #100DaysOfCode Solved LeetCode 290 – Word Pattern today! 🧠 Problem Insight: We are given a pattern and a sentence. The goal is to check whether there exists a one-to-one mapping (bijection) between characters in the pattern and words in the sentence 💡 Key Learning: One character → one unique word One word → one unique character No duplicates allowed in mapping (both directions) ⚡ Approach I Used: Split sentence into words Use two hash maps: Character → Word Word → Character Validate mapping consistency while iterating 🎯 Why this problem matters: This is a classic example of: Hashing Data consistency checks Bidirectional mapping logic (very important in interviews) 📊 Performance: ✅ Runtime: 0 ms (Beats 100%) ✅ Memory: Optimized 🔥 Takeaway: Always think in two directions when mapping relationships — it avoids hidden edge cases. #DSA #LeetCode #CodingJourney #Python #ProblemSolving #TechGrowth #Consistency #100DaysChallenge
To view or add a comment, sign in
-
-
Day 3 / 100 🚀 Solved “Reverse Integer” — a problem that looks simple but actually tests how carefully you handle edge cases. At first, reversing digits feels straightforward. But the real challenge is handling 32-bit overflow without using extra space. 💡 Key learning: Before updating the result, always check if multiplying by 10 will exceed the allowed range. Core idea: rev * 10 + digit must stay within [-2³¹, 2³¹ - 1] Highlights: • Time Complexity: O(log n) • Space Complexity: O(1) • Correctly handles negative numbers and overflow This problem reinforced a critical habit: Don’t just make the logic work — validate boundary conditions. #100DaysOfCode #LeetCode #DSA #Python #ProblemSolving #CodingInterview
To view or add a comment, sign in
-
-
🚀 Day 35 of #60DaysCodingChallenge | ABTalks Today’s problem focused on the Sliding Window Technique (Variable Window) while solving the classic Longest Substring Without Repeating Characters problem. 🔍 Key Learning: Instead of checking all possible substrings (which would be inefficient), the Sliding Window approach allows us to dynamically adjust the window size while traversing the string. This reduces the time complexity significantly and helps build a more optimized solution. 💡 What I Practiced Today • Understanding the concept of Variable Sliding Window • Efficient string processing techniques • Optimizing brute force solutions into linear time algorithms ⚙ Approach Used Two pointers (left and right) maintain the window A data structure keeps track of characters inside the window If a duplicate appears, the window shrinks from the left Track the maximum window size without repeating characters 📈 Complexity Time Complexity: O(n) Space Complexity: O(n) Consistency is slowly building stronger problem-solving skills every day. The goal is not just solving problems but understanding the patterns behind them. Looking forward to Day 36 tomorrow. 🔥 ABTalksOnAI #ABTalks #60DaysChallenge #DSA #SlidingWindow #ProblemSolving #CodingJourney #Python #LearningInPublic
To view or add a comment, sign in
-
Solved a nice Binary Tree Problem today: Print all root to leaf paths. The approach is really simple: we'll traverse the tree and store all paths that start at the root and end at a leaf node. So here’s what I did for this problem: • Used recursion with DFS to traverse the tree • Used a path list to keep track of all paths • Whenever I encountered a leaf node, I pushed it into the answer list • Once I visited a node, I removed it from my path list to backtrack and explore all paths An interesting thing I observed while solving this question: Since lists in Python are mutable references, if we push the path into the answer list, it will change all paths in the answer list. Hence, we push a copy of the path into the answer list. This is another nice example of how we use DFS and backtracking for trees. These kinds of small questions really help us solidify our recursion intuitions. #DSA #BinaryTree #Recursion #CodingPractice
To view or add a comment, sign in
-
-
🚀 Day 11 – DSA Daily Series Today’s Problem: Find Minimum in Rotated Sorted Array (LeetCode 153) Today I solved an interesting problem that involves finding the minimum element in a rotated sorted array. 🧠 Problem You are given a sorted array that has been rotated several times. The task is to find the minimum element in the array. Example: Input: nums = [3,4,5,1,2] Output: 1 💡 Approach I solved this problem using Binary Search. Key idea: • In a rotated sorted array, the minimum element lies at the rotation point • Compare the middle element with the rightmost element • If nums[mid] > nums[high], the minimum lies in the right half • Otherwise, it lies in the left half including mid By narrowing the search space, we efficiently locate the minimum element. ⏱ Complexity Time Complexity: O(log n) Space Complexity: O(1) 🔎 Key Learning Binary Search can be extended beyond simple searching and used to identify structural properties of arrays like rotation points. Continuing the DSA Daily Series — solving and learning one problem at a time. 🚀 #DSA #LeetCode #Python #Algorithms #BinarySearch #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development