Day 52 : Practicing Binary Trees on LeetCode 💡 Today’s live practical session in Alpha Plus 7.0 we solve some Binary Trees bases questions on LeetCode to test our logic. What I practiced today: ✅ Binary Tree Execution: Reinforced our core concepts by solving practical problems and tracing the exact flow of the nodes. ✅ Preorder Traversal: tackled the "Binary Tree Preorder Traversal" problem on LeetCode. ✅ Build the logic breakdown #BinaryTree #LeetCode #ProblemSolving #DSA #Java #SoftwareEngineering #100DaysOfCode #ApnaCollege
Practicing Binary Trees on LeetCode with Alpha Plus 7.0
More Relevant Posts
-
100 Days of Code Day - 24 🔁 Swap Nodes in Pairs – LeetCode Problem Solved a classic Linked List problem today! 💡 👉 Given a linked list, swap every two adjacent nodes without modifying values — only changing the links. ✅ Example: Input: [1,2,3,4] Output: [2,1,4,3] 💭 Approach: Used a dummy node and pointer manipulation to efficiently swap nodes in O(n) time and O(1) space. 📌 Key Learning: Understanding pointer handling is crucial for mastering Linked Lists. #LeetCode #Java #DSA #LinkedList #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
#Day82 Of Problem Solving Solved today’s LeetCode Daily Question and got all test cases accepted. Focused on finding the minimum distance between the target element and the given start index. Kept the approach simple—iterated through the array and updated the minimum distance using Math.abs(). Clean logic, efficient, and gets the job done. Performance: Runtime: 1 ms Memory: 45.04 MB Small problems like this are a good reminder that clarity in thinking often beats overcomplication. Staying consistent with daily practice. #LeetCode #Java #ProblemSolving #DSA #CodingJourney #LeetCode #LinkedIn
To view or add a comment, sign in
-
-
Day 101 - LeetCode Journey Solved LeetCode 856: Score of Parentheses ✅ Looks tricky at first, but turns out to be a neat pattern problem. Instead of using a stack, used depth tracking + bit manipulation to calculate score efficiently. Core idea: Every "()" contributes 2^depth So just track depth and add score at the right moment. Key learnings: • Understanding pattern inside parentheses • Using depth instead of extra space • Bit manipulation for optimization ⚡ • Clean O(n) solution without stack ✅ All test cases passed ⚡ O(n) time | O(1) space Simple logic, powerful result 💡 #LeetCode #DSA #Stack #BitManipulation #Java #CodingJourney #ProblemSolving #InterviewPrep
To view or add a comment, sign in
-
-
Day 56 : Crushing Binary Trees on LeetCode 💡 Today’s live practical session in Alpha Plus 7.0 We focused on some of the most challenging Binary Tree questions on LeetCode, breaking down the logic behind them. What I practiced today: ✅ Tree Diameter: understand the logic to calculate the absolute longest path between any two nodes in the entire tree. ✅ Maximum Path Sum: Tackled a famous "Hard" level problem! Figured out how to find the path with the highest possible sum, even if it doesn't pass through the root. ✅ Target Deletion: Wrote the recursive code to systematically find and delete leaf nodes that match a specific target value. #BinaryTree #LeetCode #ProblemSolving #DSA #Java #SoftwareEngineering #100DaysOfCode #ApnaCollege
To view or add a comment, sign in
-
-
🚀 Day 49 of my #100DaysOfCode Journey Today, I solved the LeetCode problem: Set Mismatch Problem Insight: Given an array containing numbers from 1 to n, one number is duplicated and one number is missing. The goal is to find both of them. Approach: • Used a frequency array to count occurrences of each number • Traversed the input array and updated frequency • Iterated from 1 to n: – If frequency is 2 → duplicate element – If frequency is 0 → missing element • Returned both values as the final result Time Complexity: O(n) Space Complexity: O(n) Key Learnings: • Frequency array is a simple and powerful technique for counting problems • Helps quickly identify missing and repeating elements • Clean and easy-to-understand approach for beginners Takeaway: Sometimes the simplest approach is the most effective. Mastering basic patterns like counting can solve many problems efficiently! #DSA #Java #LeetCode #100DaysOfCode #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 81 of #LeetCode Journey Solved: Subarray Sums Divisible by K Today’s problem helped me understand the power of Prefix Sum + HashMap optimization. 💡 Key Learning: Instead of checking all subarrays (O(n²)), we can use modulo + frequency map to reduce it to O(n). If two prefix sums have the same remainder, the subarray between them is divisible by K. 🧠 Concepts used: Prefix Sum Modulo Arithmetic HashMap (Frequency Count) ✅ Result: Accepted ✔️ Consistency is building confidence day by day 💪 #Day81 #DSA #Java #LeetCode #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
----Keeping the momentum going.---- Solved: * Length of Last Word (LeetCode 58) * Approach: Traversed the string from the end, skipped trailing spaces, and counted characters of the last word. * Key Learning: Simple problems reinforce strong fundamentals like string traversal and edge case handling. #LeetCode #DSA #Java #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 53 of #100DaysOfLeetCode Solved: Next Greater Element (Leetcode 496) Today’s problem was a great reminder of how powerful Monotonic Stack can be for optimization. 🔹 Approach: Used a stack to maintain decreasing elements Mapped each element to its next greater using a HashMap Reduced time complexity from O(n²) → O(n) 🔹 Key Learning: Small mistakes in conditions (like missing a !) can completely break logic. Attention to detail matters just as much as understanding the concept. 🔹 Complexity: Time: O(n + m) Space: O(n) Consistency > Perfection. Showing up daily and improving step by step. #LeetCode #DSA #Java #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 47of my #100DaysOfCode Journey Today, I solved the LeetCode problem: Mirror Distance of an Integer Problem Insight: Given a number, the task is to find the absolute difference between the original number and its reversed form. Approach: • Stored the original number in a temporary variable • Reversed the number using digit extraction (modulo and division) • Calculated the absolute difference between the original and reversed number Time Complexity: O(d), where d = number of digits Space Complexity: O(1) Key Learnings: • Digit manipulation using modulo and division is a powerful technique • Always store the original value before modifying the input • Reversing numbers is a fundamental pattern in many DSA problems Takeaway: Breaking the problem into simple steps makes even tricky-looking logic easy to solve. #DSA #Java #LeetCode #100DaysOfCode #CodingJourney
To view or add a comment, sign in
-
-
💡 Day 54 of LeetCode Problem Solved! 🔧 🌟 560. Subarray Sum Equals K 🌟 🔗 Solution Code: https://lnkd.in/g5VwiFKd 🧠 Approach: Prefix Sum & Hash Map Store cumulative sums in a Map Check for (current_sum - k) to find matching subarrays in one pass ⚡ Key Learning: Mastering the Prefix Sum + HashMap pattern is a game-changer for transforming $O(n^2)$ subarray problems into efficient $O(n)$ solutions. ⏱️ Complexity: Time: O(n) Space: O(n) #LeetCode #Java #DSA #ProblemSolving #Consistency #100DaysOfCode #CodingJourney #PrefixSum #DataStructures
To view or add a comment, sign in
-
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