Day 10 | LeetCode Learning Journal 🚀 Today I practiced Binary Tree Preorder Traversal (Problem 144) on LeetCode. This problem helped me understand how tree traversal works when we visit the root before its subtrees. 🔑 Key Points: • Traversal order: Root → Left → Right • Visit the current node first • Recursively traverse the left subtree • Then recursively traverse the right subtree • Can also be implemented using a stack (iterative approach) 🌱 What I Learned: • Basics of tree traversal techniques • How recursion naturally fits tree structures • Difference between recursive and iterative traversal • Importance of traversal order in trees • Strengthened understanding of tree fundamentals #LeetCode #100DaysOfCode #DSA #BinaryTree #PreorderTraversal #Day10
Binary Tree Preorder Traversal on LeetCode
More Relevant Posts
-
Day 23 | LeetCode Learning Journal 🚀 Today I solved Binary Tree Tilt.This problem helped me understand how to combine tree traversal with calculations at each node! 🔑 Key Points: • Used postorder traversal to calculate subtree sums. • Calculated tilt as the absolute difference of left and right subtree sums. • Accumulated tilt for every node in the tree. • Focused on returning subtree sums while updating the result. • Efficient single traversal solution. 🌱 What I Learned: • How to compute values while traversing a tree. • Importance of postorder traversal in such problems. • Better understanding of recursion with return values. • Improved handling of tree-based calculations. #LeetCode #100DaysOfCode #DSA #CodingJourney #BinaryTree #Day23 🚀
To view or add a comment, sign in
-
-
Day 11 | LeetCode Learning Journal 🚀 Today I practiced Binary Tree Postorder Traversal (Problem 145) on LeetCode. This traversal visits the root after processing both subtrees, which makes it useful for problems like deleting trees or evaluating expressions. 🔑 Key Points: • Traversal order: Left → Right → Root • Traverse the left subtree first • Then traverse the right subtree • Visit the root node at the end • Can be implemented using recursion or stacks 🌱 What I Learned: • How postorder traversal processes children before the parent • Why this traversal is useful in tree deletion and evaluation problems • Differences between preorder, inorder, and postorder traversals • Strengthened understanding of recursive tree algorithms • Built a stronger foundation for advanced tree problems #LeetCode #100DaysOfCode #DSA #BinaryTree #PostorderTraversal #Day11
To view or add a comment, sign in
-
-
🚀 Day 4/100 — LeetCode Challenge Today I practiced problems based on the Two Pointer technique, a powerful approach for solving array and string problems efficiently. Problems solved: • Valid Palindrome • Two Sum II (Input Array Is Sorted) 🧠 Concept: Two pointers starting from different ends of the array/string and moving toward each other. 💡 Key Learning: Two pointer techniques often help eliminate nested loops and reduce time complexity to O(n). 📂 Solutions Repository https://lnkd.in/gkFh2mPZ Understanding these patterns is helping me recognize more efficient ways to approach problems. #100DaysOfLeetCode #DSA #LeetCode #CodingChallenge #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Day 19/100 — LeetCode Challenge (Revision Day) Today I revised Monotonic Stack problems: • Daily Temperatures • Next Greater Element I 🧠 Key Learning: Monotonic stack is extremely useful for solving “next greater/smaller element” problems efficiently in O(n) time. Revisiting these problems helped strengthen pattern recognition and understanding. 📂 Solutions Repository https://lnkd.in/gkFh2mPZ #100DaysOfLeetCode #DSA #LeetCode #CodingChallenge #Revision
To view or add a comment, sign in
-
Day 16 | LeetCode Learning Journal 🚀 Today I solved Binary Tree Right Side View . This problem helped me understand how to identify the nodes visible when looking at a binary tree from the right side. 🔑 Key Points: • Uses Breadth-First Search (BFS) with a queue. • Traverse the binary tree level by level. • At each level, capture the last node visited. • The last node of every level represents the right side view. • Continue until all levels of the tree are processed. 🌱 What I Learned: • How to apply level order traversal in binary trees • Identifying the rightmost node at each level • Better understanding of queue-based traversal • Strengthened my binary tree traversal concepts • Improved problem-solving skills in tree-based problems #LeetCode #100DaysOfCode #DSA #BinaryTree #BFS #RightSideView #Day16 🚀
To view or add a comment, sign in
-
-
🚀 Day 27/100 – LeetCode Challenge ✅ Problem Solved: Remove Duplicates from Sorted Array Today’s problem was a classic example of using the two-pointer technique. The goal was to remove duplicates from a sorted array in-place while maintaining the order of elements. I used two pointers to track unique elements and overwrite duplicates efficiently without using extra space. 💡 Key Learning: Two-pointer technique is very effective for array problems In-place operations help reduce space complexity Understanding problem constraints leads to optimal solutions ⚡ Complexity: Time: O(n) Space: O(1) Consistency is building confidence step by step 🚀 #Day27 #100DaysOfCode #LeetCode #DSA #Cpp #CodingJourney #TwoPointers #ProblemSolving
To view or add a comment, sign in
-
-
Day 37 : Practicing Backtracking on LeetCode 💡 Today’s live practical session in Alpha Plus 7.0 was all about execution. We took the theory of Backtracking and applied it directly to solve problems on LeetCode. Today’s Checklist: ✅ Backtracking Execution: Reinforced the core logic of exploring all possible combinations and retreating when necessary. ✅ Phone Keypad Problem: Successfully solved the classic "Letter Combinations of a Phone Number" problem on LeetCode. ✅ Mapping Logic: Mastered how to map numeric digits to character arrays and recursively generate every single valid string combination. #Backtracking #LeetCode #DSA #Algorithms #SoftwareEngineering #100DaysOfCode #ApnaCollege
To view or add a comment, sign in
-
-
Day 29 – LeetCode Journey 🚀 Solved Two Sum II – Input Array Is Sorted using the Two Pointer technique, leveraging the sorted nature of the array for an optimal solution. 🔹 Time Complexity: O(n) 🔹 Runtime: 2 ms (Beats 96.37%) 🔹 Memory Usage: 48.58 MB This problem is a great reminder that recognizing patterns (like sorted arrays) can significantly reduce complexity and improve efficiency. Small optimizations, big impact 📈 Staying consistent and sharpening problem-solving skills every day. #LeetCode #DSA #ProblemSolving #CodingJourney #SoftwareEngineering #Consistency #Learning
To view or add a comment, sign in
-
-
🚀 Day 16/100 — LeetCode Challenge (Revision Day) Today I focused on revising core problems from Arrays and Two Pointer techniques. Revisited: • Two Sum • Two Sum II • Container With Most Water 🧠 Key Learning: Revision helps reinforce patterns and improves problem-solving speed and confidence. Sometimes going back is the best way to move forward. 📂 Solutions Repository https://lnkd.in/gkFh2mPZ #100DaysOfLeetCode #DSA #LeetCode #CodingChallenge #Revision
To view or add a comment, sign in
-
🚀 Day 3/100 — LeetCode Challenge I thought this needed nested loops at first. Turns out, it doesn’t. Solved LeetCode 53: Maximum Subarray My first instinct was to check all subarrays (O(n²)), but that’s inefficient. Then I came across a much cleaner idea: 👉 Instead of checking everything, just keep track of the current sum 1) If the current sum becomes negative → reset it to 0. 2) Keep updating the maximum sum along the way. This approach (Kadane’s Algorithm) makes the solution much more efficient. 💡 What I learned: You don’t always need to explore all possibilities — sometimes dropping bad states early leads to the optimal solution. 🧠 Time Complexity: O(n) 💾 Space Complexity: O(1) Small problem, but a very powerful pattern. #LeetCode #DSA #100DaysOfCode #Cpp #ProblemSolving #CodingJourney
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
Talent without action is just potential. If you believe in your skills, it’s time to step forward. Use your talent, take the initiative, and apply directly with Infovix. Join our channel : https://whatsapp.com/channel/0029Vb7MSYn7tkj1BLbqSX2P