Day 9: 90-Day Coding Challenge 🚀 Continuing the journey by exploring more tree-based problems and sharpening my understanding of tree properties. Today’s problem focused on checking whether a Binary Tree is a Binary Search Tree (BST). The goal was to verify if the tree satisfies the BST property across all nodes. At first, it might seem enough to compare each node with its immediate children, but that approach fails for deeper levels in the tree. Instead of relying on local comparisons, I used a recursive Depth-First Search (DFS) approach: • Maintained a valid range (min, max) for each node • Ensured every node’s value lies within its allowed limits • Updated the range while moving left and right in the tree • Base case: return True when reaching a null node This approach ensures an efficient solution with O(n) time complexity, where n is the number of nodes. Today’s learning highlights: ✅ Understood the importance of global constraints in trees ✅ Strengthened recursive thinking with range-based validation ✅ Learned why local checks can lead to incorrect solutions ✅ Improved problem-solving approach for tree validation problems Tree problems continue to challenge logical thinking and recursion skills — another great step forward in the journey 💡 Excited to keep the momentum going! #90DaysOfCode #DataStructures #Algorithms #Python #CodingJourney #Recursion #BinaryTree
Verifying Binary Search Trees with Recursive DFS
More Relevant Posts
-
Day 10: 90-Day Coding Challenge 🚀 Continuing the journey by strengthening my fundamentals in array-based problems and improving problem-solving efficiency. Today’s problem focused on the classic Two Sum problem. The goal was to find two indices in an array such that their values add up to a given target. At first, a brute-force approach using nested loops works, but it results in O(n²) time complexity, which is not efficient for larger inputs. Instead, I used an optimized approach with a HashMap (dictionary): • Iterated through the array once • Stored each number along with its index • Checked if the complement (target - current number) already exists • Returned the indices as soon as a match is found This approach reduces the time complexity to O(n) with O(n) space complexity. Today’s learning highlights: ✅ Understood the importance of optimizing brute-force solutions ✅ Learned how HashMaps improve lookup efficiency ✅ Strengthened problem-solving with single-pass solutions ✅ Improved thinking in terms of time vs space trade-offs Simple problems like these are great for building strong fundamentals and efficient thinking 💡 Excited to keep the momentum going! #90DaysOfCode #DataStructures #Algorithms #Python #CodingJourney #Arrays #HashMap
To view or add a comment, sign in
-
🚀 Day 78 – Diving Deeper into Randomness & Voice in Python 🎙️✨ Today’s exploration added more exciting tools to my Python journey: 🔹 Random Module (Advanced Functions) – Practiced uniform(), choices(), and sample() to generate floating‑point randomness, weighted selections, and unique subsets. These functions showed how randomness can be fine‑tuned for simulations, games, and creative problem‑solving. 🔹 Text‑to‑Speech with pyttsx3 – Learned how to install and use this library to convert text into voice. It was fascinating to see code literally speak back, opening doors to accessibility features, interactive applications, and fun projects. 🌱 Reflection – Randomness taught me that unpredictability can be controlled with precision, while text‑to‑speech reminded me that code can connect with people in more human ways. Together, they highlight how programming bridges logic and creativity. ✨ Grateful to Rudra Sravan kumar sir and the 10000 Coders team for guiding me through these practical concepts that make coding more engaging and versatile. ⚡ Day 78 was about giving code a voice and mastering randomness with purpose — skills that make applications dynamic, interactive, and impactful. #Day78 #PythonLearning #RandomModule #pyttsx3 #CodingJourney #10000Coders #LearnInPublic #100DaysOfCode
To view or add a comment, sign in
-
Some problems are not about removing elements, but about removing them wisely. Day 25/100 — Data Structures & Algorithms Journey Today’s Problem: Remove K Digits This problem helped me understand how greedy decisions can lead to an optimal solution. Approach: Instead of trying all possible combinations, I used a stack-based greedy approach. While traversing the number, I removed digits that were larger than the current digit to make the number as small as possible. If there were still digits left to remove, I removed them from the end. Finally, I handled leading zeros to get the correct result. At each step: - Remove larger digits from stack - Add current digit - Handle remaining removals - Remove leading zeros Key Takeaways: Greedy algorithms help make optimal local decisions Stack is useful for maintaining order Small changes can significantly impact the final result Thinking step-by-step avoids unnecessary complexity This problem strengthened my understanding of greedy strategies and stack usage. #DSA #LeetCode #Greedy #Stack #ProblemSolving #SoftwareEngineering #CodingJourney #100DaysOfCode #TechLearning #DeveloperJourney #Programming #Python #InterviewPreparation #CodingSkills #ComputerScience #FutureEngineer #TechCareers #SoftwareDeveloper #LearnInPublic #OpenToWork
To view or add a comment, sign in
-
-
Day 12: 90-Day Coding Challenge 🚀 Continuing the journey of sharpening problem-solving skills, today I focused on array manipulation and optimization techniques. Today’s problem involved finding the minimum jumps to reach the end of an array, where each element represents the maximum steps you can move forward from that position. Instead of using a recursive or DP approach, I implemented a greedy strategy: • Tracked the farthest reachable index at each step • Maintained the current jump range, only incrementing jumps when reaching the end of this range • Iterated through the array efficiently to ensure the minimum number of jumps • By the end, the total jumps represent the optimal path to reach the last index This approach emphasizes thinking ahead and managing ranges, rather than checking every possible path. Time Complexity: O(n) Space Complexity: O(1) Today’s learning highlights: ✅ Explored greedy optimization for minimum jumps ✅ Practiced tracking ranges to reduce unnecessary computations ✅ Strengthened understanding of forward-looking strategies in arrays ✅ Improved problem-solving efficiency and approach flexibility It’s fascinating to see how array-based problems can be tackled in multiple ways while keeping time and space efficient 💡 Excited for Day 13 and more problem-solving challenges! #90DaysOfCode #DataStructures #Algorithms #Greedy #CodingJourney #Python #ProblemSolving #ArrayProblems
To view or add a comment, sign in
-
How do you explain a “function” to a newbie?🤔 For me, the simplest way is this: a function is a reusable tool for a specific task. ✨ Think about it like this: when you want to sweep your floor, you don’t reinvent the broom every time, right? You grab the broom, sweep, and done. ✅ In programming, a function works the same way. Once you’ve written it, you can reuse it anywhere you need that task done. No need to repeat the steps from scratch. So the next time someone asks you what a function is, don’t get lost in technical jargon. Just say: “It’s your broom in the coding world. Once you have it, you just keep using it.” 😉 What everyday object would you compare a function to? #Programming #Python #BackendDevelopment #SoftwareEngineering #LearnigInPublic
To view or add a comment, sign in
-
Day 11: 90-Day Coding Challenge 🚀 Continuing the journey by strengthening problem-solving skills and exploring different approaches to array-based problems. Today’s problem was the Jump Game. The goal was to determine whether it’s possible to reach the last index of an array, where each element represents the maximum jump length from that position. Instead of the usual forward traversal, I implemented a backward greedy approach: • Started from the last index as the target • Traversed the array from right to left • Checked if the current index can reach the “target” • If yes, updated the target to the current index • Repeated until reaching the start If the target becomes index 0, it means we can reach the end successfully ✅ This approach efficiently reduces the problem by continuously shrinking the goal position. Time Complexity: O(n) Space Complexity: O(1) Today’s learning highlights: ✅ Explored an alternative greedy strategy (backward traversal) ✅ Learned how to reduce problems by shifting the goalpost ✅ Strengthened understanding of reachability problems ✅ Improved thinking beyond standard forward approaches It was interesting to see how the same problem can be solved from different directions with equal efficiency 💡 Excited to keep learning and improving! #90DaysOfCode #DataStructures #Algorithms #Greedy #CodingJourney #Python #ProblemSolving
To view or add a comment, sign in
-
🚀 Day 03 of #ABTalks Global Coding Challenge (Data Science Track) Today’s focus was on Conditional Statements in Python. 💻 Task: Accept student marks and classify them as Pass/Fail using conditions. 🔍 What I implemented: Took student details as input Applied if-elif-else logic Classified results into: ✔️ Distinction ✔️ First Class ✔️ Pass ❌ Fail 💡 Key Learning: Conditions are powerful—they allow programs to make decisions just like we do in real life. This is the foundation of logic used in data analysis and machine learning. 📂 GitHub Repository: https://lnkd.in/gHCvUemF Step by step, building consistency and clarity 🚀 “Great decisions start with simple conditions—master them today.” ABTalksOnAI, Anil Bajpai #Python #DataScience #LearningInPublic #ABTalks #CodingChallenge
To view or add a comment, sign in
-
🚀 Cracking Data Structures & Algorithms — One Problem at a Time! Today, I solved another problem on LeetCode and pushed my understanding a step further. 💡 DSA isn’t just about coding — it’s about learning how to think, optimize, and approach problems with clarity. 🔍 What I focused on: • Breaking down the problem step-by-step • Choosing the right data structure • Optimizing time & space complexity • Writing clean and readable code Consistency is the real game-changer. Every problem solved is one step closer to becoming a better developer. 💪 📌 Sharing my solution and approach — feedback is always welcome! #DSA #LeetCode #ProblemSolving #CodingJourney #100DaysOfCode #Python #SoftwareDevelopment #TechLearning #CodingPractice
To view or add a comment, sign in
-
🚀 Cracked the Spiral Matrix problem on LeetCode — and here’s the mindset behind it 👇 Most people jump straight into coding this problem. I didn’t. Instead, I approached it like a boundary management problem 🧠 🔍 My thought process: • Treat the matrix like a shrinking box • Maintain 4 pointers: top, bottom, left, right • Traverse layer by layer — not element by element • After each traversal, shrink the boundaries inward This helped me: ✅ Avoid unnecessary conditions ✅ Prevent duplicate traversals ✅ Keep the logic clean and scalable The real learning wasn’t just solving it — it was realizing how visualizing the structure simplifies the code. 💡 Sometimes the difference between confusion and clarity is just how you frame the problem. 🔥 Consistency + clarity > brute force coding #LeetCode #DSA #CodingJourney #ProblemSolving #Python #WomenInTech #TechLearning #SoftwareEngineering #100DaysOfCode #StudentDeveloper #CodingMindset #LearnInPublic
To view or add a comment, sign in
-
-
↩️ Stack becomes unforgettable when students connect it to browser history. Today in class, instead of teaching LIFO as just another DSA rule, I mapped Stack to something students use every day: 🌐 browser back button 📝 undo in code editors 📱 mobile app navigation 📂 file history systems The moment they understood: ✅ Push = visit a new page ✅ Pop = go back ✅ Peek = current active page …the topic instantly shifted from theory to product workflow thinking. This is where Python DSA starts building real software architecture intuition. 📌 Swipe through the slides to see Python implementation + real-world projects. Where else do you use Stack in real systems? 👇 #Python #DSA #Stack #PythonDSA #Teaching #Programming #EdTech
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