Recently wrapped up one of my bigger projects this semester: an Appointment Book Manager in Java. This one pulled together a lot of what I’d been learning in my DSA course all at once: ADTs, iterators, binary search trees, recursion, node removal, and delegation. The timing made it especially meaningful—I was covering recursion and BSTs in both my DSA course (University of Wisconsin-Milwaukee) and CodePath TIP 102, while also attending DSA labs and preparing for technical mock interviews. Writing the code and then walking through my approach out loud forced me to articulate my thinking clearly under pressure and really lock in the concepts. A huge thank you to CodePath and to my DSA professor John Boyland for their continual support and guidance throughout this journey. The combination of both has pushed me further than I expected this semester. What I built: • Implemented a NewApptBook ADT backed by a binary search tree, designing recursive add, remove, and traversal methods from scratch for an efficient sorted collection with O(log n) search performance. • Built a BST iterator with a stack for in-order traversal, a version counter, and a reference to the last returned node, with hasNext(), next(), and remove() implemented with version tracking and a custom invariant checker. The iterator keeps track of position as the tree structure shifts so traversal stays consistent and controlled. • Added version tracking and invariants so any structural modification mid-iteration throws a ConcurrentModificationException instead of silently producing wrong outputs—fail fast, catch it early, fix it quickly. That mindset of building with both the developer and the end user in mind is something I want to carry into everything I build. • Engineered a recursive node removal algorithm that replaces removed nodes with in-order successors, preserving BST order across edge cases including nodes with 0, 1, or 2 children. A lot happening at once that couple of weeks, but it genuinely paid off. I learned a lot and grew as a developer. #Java #DataStructures #BinarySearchTree #Algorithms #CS #CodePath
Java Appointment Book Manager with Binary Search Tree
More Relevant Posts
-
🚀 Day 20 of My DSA Journey — Cracking “Power of Two” Today I solved the classic problem: Check if a number is a power of 2 on LeetCode. 🔍 Problem Understanding Given an integer n, we need to determine whether it can be represented as: 👉 ( n = 2^x ) where ( x \ge 0 ) 💡 Brute Force Approach Keep multiplying 2 until we reach or exceed n If we hit exactly n, return true ⛔ Not efficient for large values ⚡ Optimized Approach (My Solution) Instead of multiplying, I used a smarter trick: 👉 Keep dividing the number by 2 Steps: If n <= 0 → return false While n > 1 If n % 2 != 0 → not divisible → return false Else divide n by 2 If we reach 1 → return true 🧠 Example Walkthrough Input: n = 8 8 → 4 → 2 → 1 ✅ So, it is a power of 2 Input: n = 10 10 → not divisible cleanly ❌ So, not a power of 2 ⏱ Complexity Analysis Time Complexity: O(log n) Space Complexity: O(1) 🎯 Key Learning Problems that involve repeated division or multiplication often hint toward logarithmic optimization Always think: Can I reduce the number step by step instead of building it? 🙏 Grateful for the consistency and learning every single day 📈 Small steps daily = Big growth over time #DSA #LeetCode #CodingJourney #ProblemSolving #Java #CPP #100DaysOfCode #TechGrowth #Consistency
To view or add a comment, sign in
-
-
🚀 Day 34 of My DSA Journey – Cracked “Valid Parentheses” on LeetCode! 🔥 Today I solved the classic Valid Parentheses problem, and it turned out to be a great exercise in understanding stack-based logic and order validation. 🧩 Problem Understanding Given a string containing () { } [ ], we need to check: ✔ Every opening bracket has a matching closing bracket ✔ The order of brackets is correct 🐢 Brute Force Thought Initially, you might think of checking counts of brackets… But ❌ this fails for cases like: ([)] → counts match but order is wrong 👉 So, count alone is not enough! ⚡ Optimized Approach (Stack – LIFO) We use a Stack because it follows Last In First Out: Steps: Traverse each character If it's an opening bracket → push to stack If it's a closing bracket: Check if stack is empty → invalid ❌ Pop and compare with expected opening bracket At the end → stack must be empty ✅ 🔍 Example Walkthrough Input: "([{}])" Push ( → [( Push [ → [( [ Push { → [( [ { Match } → pop { Match ] → pop [ Match ) → pop ( 👉 Final stack empty → ✅ Valid ⏱ Complexity Time: O(n) Space: O(n) 💡 Key Learning 👉 Order matters more than count 👉 Always check stack empty before pop 👉 Final validation = stack should be empty 🙏 Gratitude Thanks to my mentors and resources guiding me through DSA 🙌 🔁 Consistency Note Showing up daily and solving even one problem is building my confidence step by step 💪 #DSA #LeetCode #Java #CodingJourney #ProblemSolving #Stack #LearningInPublic #SoftwareEngineering #Consistency
To view or add a comment, sign in
-
-
💯 Reached 300 LeetCode Problems — A Step Forward in My DSA JourneyI’m excited to share that I’ve solved 300 problems on LeetCode, building a strong foundation in Data Structures and Algorithms. Throughout this journey, I focused on: • Arrays & Strings • Linked Lists • Stacks & Queues • Recursion & Backtracking This helped me improve: ✅ Problem-solving skills ✅ Logical thinking ✅ Writing optimized code 💡 Advice for Beginners (based on my experience): If you’re just starting DSA, don’t try to learn everything at once. 👉 Start with: • Arrays & Strings (very important basics) • Then move to Linked Lists • Practice Stacks & Queues • Learn Recursion and Backtracking 👉 Important Tips: • Focus on understanding patterns, not just solutions • Solve problems consistently (even 2–3 per day) • Don’t jump into advanced topics like Trees, Graphs, or Dynamic Programming too early • Revisit problems you couldn’t solve Consistency matters more than speed. Small daily progress leads to big results. Still learning, still improving 💪 Let’s keep growing 🚀 #LeetCode #DSA #CodingJourney #ProblemSolving #Java #Beginners #Consistency 👍
To view or add a comment, sign in
-
-
Day 55 of 100 Days of LeetCode 💻 Today I solved Longest Consecutive Sequence — and honestly, this one taught me more about coding discipline than algorithms. At first, my approach was correct: Used HashSet for O(1) lookup Applied the “start of sequence” logic But I still got TLE. The reason? A tiny mistake: if(!set.contains(num-1)); That single ; made my condition useless and turned my O(n) solution into O(n²). 💡 Lesson learned: Don’t just think your logic is right → verify what your code actually does Small syntax mistakes can completely break optimal solutions Debugging is just as important as problem-solving Finally fixed it and got Accepted ✅ Slowly improving not just in DSA, but in writing cleaner and more careful code. #100DaysOfLeetCode #DSA #Java #CodingJourney #Learning
To view or add a comment, sign in
-
-
Day 56 of My DSA Journey Today I solved LeetCode 162 – Find Peak Element on . 📌 Problem Given an array "nums", find a peak element and return its index. 👉 A peak element is one that is greater than its neighbors. You can assume: • "nums[-1] = -∞" and "nums[n] = -∞" --- 🧠 Approach – Binary Search (Optimized) Instead of checking every element (O(n)), I used Binary Search. Key Idea: • Calculate "mid" • Compare "nums[mid]" with "nums[mid + 1]" 👉 If "nums[mid] > nums[mid + 1]" → We are in a descending part, so peak lies on the left side (including mid) 👉 Else → We are in an ascending part, so peak lies on the right side Repeat until "start == end" → that index is a peak. --- ⏱ Time Complexity: "O(log n)" — Efficient binary search 📦 Space Complexity: "O(1)" — No extra space used --- 💡 Key Learnings ✔ Using binary search on unsorted-looking problems ✔ Understanding pattern-based decision making ✔ Learning that a problem can have multiple valid answers (any peak) This problem really strengthens intuition for advanced binary search patterns 🚀 --- Consistency continues — getting better every day 💪🔥 #100DaysOfCode #DSA #BinarySearch #LeetCode #Java #ProblemSolving #CodingJourney #DeveloperJourney #Programming #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Day 56 of my DSA Journey Today, I worked on a Hard-level problem from LeetCode: 👉 Problem #4 – Median of Two Sorted Arrays (LeetCode) This problem is well-known for its complexity and is frequently asked in top product-based companies. 💡 What I focused on: Understanding the problem deeply instead of jumping directly to the optimal solution Implementing a merge + sort approach to build a clear foundation Applying the two-pointer technique to efficiently identify the median Handling both odd and even length cases carefully ⚙️ Approach Used: Merged both input arrays into a single array Sorted the combined array Used two pointers (i and j) moving towards the center Determined the median based on whether the length is odd or even 📈 Key Learning: Even though the optimal solution has a time complexity of O(log(min(m, n))), building a correct and intuitive approach first is crucial. It strengthens problem-solving skills and helps in understanding advanced techniques later. 🎯 Takeaway: Consistency and clarity in logic are more important than immediately writing the most optimized code. 🔥 Step by step, moving closer to mastering Data Structures & Algorithms. #DSA #LeetCode #ProblemSolving #Java #CodingJourney #PlacementPreparation #Consistency #Learning
To view or add a comment, sign in
-
-
🚀 DSA Practice — Getting Better Step by Step! 📅 Today’s Problem: Find Square Root of a Number (Floor Value) Solved using TakeUForward platform 💻 Today’s problem was a great example of applying Binary Search beyond just searching elements. 🔹 Approach Used: Binary Search on Answer Instead of checking every number, I used binary search to efficiently find the square root by narrowing down the range. ⏱ Time Complexity: O(log n) 💾 Space Complexity: O(1) 💡 Key Learning: Binary Search is not limited to sorted arrays — it can be applied to optimize problems where the answer lies within a range. This problem helped me understand how to reduce time complexity from O(n) to O(log n) by thinking in terms of search space rather than brute force. 🔥 Consistency continues — learning something new every day! takeUforward Striver #BinarySearch #takeUforwardtakeUforward #DSA #Algorithms #Coding #Java #ProblemSolving #SoftwareEngineering #Consistency
To view or add a comment, sign in
-
-
Day 12 of #50DaysOfLeetCode Challenge Today, I dived deep into one of the most fundamental yet tricky operations in a Binary Search Tree: Deleting a Node. At first glance, it seems simple, but the real challenge lies in re-connecting the nodes correctly so the BST property remains intact. Using a pen and paper to dry run the logic made a huge difference in understanding how the tree "heals" itself after a node is removed. The 3 Scenarios I explored: 1. The Leaf Node: Simple! Just remove it (set parent's child to null). 2. One Child: The node’s child simply "steps up" and takes its place. 3. Two Children (The Tricky Part): To keep the tree valid, we find the Inorder Successor (the smallest value in the right subtree), swap it with the target node, and then delete the successor. DSA isn't just about writing code; it’s about visualizing the structure and understanding the "why" behind every pointer change. #DataStructures #Algorithms #Java #LeetCode #CodingJourney #BST #ProblemSolving #ContinuousLearning
To view or add a comment, sign in
-
-
The most underrated skill in software engineering? Reading your own error messages. 🧠 I spent weeks Googling errors without actually reading what they said. ModuleNotFoundError? Google it. KeyError? Google it. Push rejected? Panic, then Google it. Then something shifted. I started actually reading the message. "Push rejected — secret scanning found an API key in commit abc123" That's not cryptic. That's a complete sentence. It literally tells you what happened and where. Now when I hit an error: 1. Read it fully 2. Think about what it's saying 3. Then search if needed This sounds obvious. But most beginners (including past me) treat errors like alarms to escape — not messages to read. Working on StemLink taught me this fast. When you're building a real product, you can't just skip past errors. You have to understand them. Your compiler is trying to help you. Let it. #SoftwareEngineering #Python #Programming #DevMindset #StemLink #LearnToCode #IITColombo #CS
To view or add a comment, sign in
-
-
🚀 Day 109 DSA Problem Solving 📌 Problem Solved: Maximum Distance Between a Pair of Values 💡 Level: Medium 🧠 Problem Idea Given two non-increasing arrays, find the maximum distance (j - i) such that: i ≤ j nums1[i] ≤ nums2[j] 🔍 Key Learning Today reinforced a powerful pattern: 👉 When arrays are sorted, always think about Two Pointers before brute force. ⚙️ Approach Used Used Two Pointers (i, j) If condition satisfies → expand j to maximize distance Else → move i to find a smaller value ⏱ Time Complexity O(n + m) ✅ (No nested loops, super efficient) 💭 Real Journey Behind the Solution Initially, I thought about checking all pairs (brute force), but that would lead to TLE. Then I noticed both arrays are non-increasing, which unlocked the two-pointer optimization. This is a reminder that: 👉 Observing constraints carefully can completely change the approach. 📈 Concepts Practiced Two Pointers Greedy Thinking Array Traversal Optimization 🔥 Takeaway Not every problem needs complex logic—sometimes the smartest solution is just about moving pointers wisely. #Day109 #DSAJourney #LeetCode #Coding #Java #ProblemSolving
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