🚀 Day 12/100 – #100DaysOfDSA Today was all about handling edge cases and smart traversal in Linked Lists 🔗 🔹 Problems Solved: 1. Intersection of Two Linked Lists 2. Remove Linked List Elements 💡 Key Learnings: 👉 Problem 1: Intersection of Two Linked Lists Used a HashSet approach Store nodes of one list and check in the other ✅ O(n + m) Time ❌ O(n) Space 💡 Optimization Insight: Can be solved using Two Pointer Technique with O(1) space Traverse both lists → switch heads → they meet at intersection 👉 Problem 2: Remove Linked List Elements Traverse the list and remove nodes matching given value Use a dummy node to handle edge cases (like removing head) 👉 Key Idea: Always keep track of previous node while deleting ✅ O(n) Time ✅ O(1) Space 🔥 What I learned today: Handling edge cases (like deleting head nodes or null cases) is just as important as solving the problem itself. Also learned that there’s always a more optimal solution worth exploring 👀 Day 12 done ✅ Let’s keep going strong 💪 #100DaysOfCode #DSA #LinkedList #ProblemSolving #CodingJourney #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic #Developers
Handling Edge Cases in Linked Lists with HashSet and Two Pointer Technique
More Relevant Posts
-
🚀 Day 13/100 – #100DaysOfDSA Today was all about efficient deletion in Linked Lists and handling edge cases in a single pass 🔗 🔹 Problems Solved: 1. Remove Nth Node From End of List 2. Remove Duplicates from Sorted List 💡 Key Learnings: 👉 Problem 1: Remove Nth Node From End Used Two Pointer Technique (Fast & Slow) Move fast pointer n steps ahead Then move both pointers until fast reaches the end Slow will be just before the node to delete 👉 Key Trick: Use a dummy node to handle edge cases (like removing head) ✅ One-pass solution ✅ O(n) Time ✅ O(1) Space 👉 Problem 2: Remove Duplicates from Sorted List Since list is sorted → duplicates are adjacent Traverse and compare current node with next Skip duplicate nodes ✅ O(n) Time ✅ O(1) Space 🔥 What I learned today: Using dummy nodes + two pointers makes Linked List problems much cleaner and avoids edge-case bugs. Patterns are repeating, confidence is growing 📈 Day 13 done ✅ Let’s keep pushing 💪 #100DaysOfCode #DSA #LinkedList #ProblemSolving #CodingJourney #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic #Developers
To view or add a comment, sign in
-
🚀 Day 10/100 – #100DaysOfDSA Double digits! 🎯 Today was all about mastering Linked List traversal and pointer manipulation. 🔹 Problems Solved: 1. Middle of the Linked List 2. Reverse Linked List 💡 Key Learnings: 👉 Problem 1: Middle of the Linked List Used Two Pointer Technique (Slow & Fast pointers) Slow moves 1 step, Fast moves 2 steps When fast reaches end → slow is at the middle ✅ O(n) Time ✅ O(1) Space ✅ Efficient single-pass solution 👉 Problem 2: Reverse Linked List Iterative approach using three pointers: prev, current, next Reverse links one by one 👉 Core Idea: Change direction of next pointer at each step ✅ O(n) Time ✅ O(1) Space 🔥 What I learned today: Linked Lists are all about pointer control — once you master that, many problems become easier. The slow & fast pointer technique is 🔥 — super useful pattern! Day 10 done ✅ Staying consistent 💪 #100DaysOfCode #DSA #LinkedList #ProblemSolving #CodingJourney #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic #Developers
To view or add a comment, sign in
-
🚀 Day 23 of #60DaysOfDSA Today I implemented Quick Sort, a powerful Divide & Conquer algorithm used for sorting. 🔍 What I learned: Quick Sort works by selecting a pivot element It partitions the array into: Elements smaller than pivot Elements greater than pivot Then recursively sorts both parts ⚡ Key Insight: “Partitioning is the heart of Quick Sort.” Even a small mistake in index handling or swapping can completely break the logic. 💻 Key Concepts Covered: ✔️ Pivot selection (last element) ✔️ Partition logic (Lomuto method) ✔️ Recursion ✔️ In-place sorting 🧠 Takeaway: Quick Sort is not just about writing code, it’s about understanding how elements move and how recursion divides the problem. Consistency > Perfection 🚀 One step closer to becoming better every day! #DSA #QuickSort #CodingJourney #JavaScript #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 2/100 – #100DaysOfDSA Continuing the journey with two interesting problems today! 🔹 Problems Solved: Best Time to Buy and Sell Stock Reverse String 💡 Key Learnings: 👉 Problem 1: Best Time to Buy & Sell Stock Used a greedy + two pointer mindset Track the minimum price so far (buy) and calculate profit at each step Update max profit whenever a better opportunity appears ✅ O(n) Time ✅ O(1) Space 👉 Problem 2: Reverse String Classic Two Pointer Technique One pointer at start, one at end Swap characters and move inward ✅ In-place solution ✅ No extra memory used 🔥 What I learned today: Sometimes the best solutions are not complex — just about tracking the right values at the right time. Consistency > Perfection. See you on Day 3 💪 #100DaysOfCode #DSA #LeetCode #ProblemSolving #CodingJourney #JavaScript #Developers #TechGrowth #SoftwareEngineer #LearningInPublic
To view or add a comment, sign in
-
🚀 Day 11/100 – #100DaysOfDSA Today was all about applying smart pointer techniques on Linked Lists 🔗 🔹 Problems Solved: 1. Linked List Cycle 2. Palindrome Linked List 💡 Key Learnings: 👉 Problem 1: Linked List Cycle Solved using Floyd’s Cycle Detection Algorithm (Slow & Fast pointers) Slow moves 1 step, Fast moves 2 steps If they ever meet → cycle exists ✅ O(n) Time ✅ O(1) Space (no extra memory) 👉 Problem 2: Palindrome Linked List Find middle using slow & fast pointers Reverse second half of the list Compare both halves 👉 Key Insight: Convert problem into comparison of two halves ✅ O(n) Time ✅ O(1) Space 🔥 What I learned today: The slow & fast pointer technique is extremely powerful — from finding cycles to solving palindrome problems efficiently. Patterns are starting to repeat, and that’s where real understanding builds 👀 Day 11 done ✅ Let’s keep pushing 💪 #100DaysOfCode #DSA #LinkedList #ProblemSolving #CodingJourney #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic #Developers
To view or add a comment, sign in
-
🚀 Day 5/100 – #100DaysOfDSA Today’s focus was on recursion and understanding how problems break down into smaller subproblems. 🔹 Problems Solved: 1. Power of Two 2. Fibonacci Number 💡 Key Learnings: 👉 Problem 1: Power of Two (Using Recursion) Base Case: n === 1 → true If n is divisible by 2, recursively check n / 2 If not divisible → false ✅ Clean recursive breakdown ✅ Helps understand divide-by-2 pattern 👉 Problem 2: Fibonacci Number (Using Recursion) Base Cases: F(0) = 0, F(1) = 1 Recursive Relation: F(n) = F(n-1) + F(n-2) ✅ Learned that: Simple recursion is intuitive 🔥 What I learned today: Recursion is powerful for understanding problem structure. Building consistency, one step at a time 💪 #100DaysOfCode #DSA #Recursion #LeetCode #ProblemSolving #CodingJourney #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic
To view or add a comment, sign in
-
🚀 Day 21 of #DevDSA 🔹 Problem: Merge Two Sorted Arrays (Using Extra Space) Today I worked on merging two sorted arrays into a single sorted array using an additional array. 🧠 Approach: Used two pointers (l for nums1 and r for nums2) Compared elements one by one Pushed the smaller element into a new mergedArray Handled equal elements by pushing both Continued until one array is exhausted 💡 Key Idea: Since both arrays are already sorted, we can efficiently merge them in linear time without sorting again. ⏱ Time Complexity: O(m + n) 📦 Space Complexity: O(m + n) 📌 What I learned: Two-pointer technique is very powerful for sorted data Writing clean conditions avoids unnecessary complexity Always think about edge cases (like remaining elements after loop) 💻 Next Step: Try solving the same problem without extra space (in-place optimization 🔥) #DSA #100DaysOfCode #CodingJourney #JavaScript #InterviewPrep
To view or add a comment, sign in
-
-
Most engineers draw system diagrams. I built them alive. 🔥 Load Balancers. Caching layers. CAP Theorem. Message Queues — concepts that took me weeks to grasp from textbooks, now rendered as live, animated flows you can actually watch in your browser. Just pure HTML, CSS, and JavaScript proving you don't need heavy dependencies to build something beautiful and blazing fast. 11 FAANG-level concepts. Zero jargon. One visual atlas. If you're a developer who learns by seeing, this was built for you #SystemDesign #SoftwareEngineering #WebDevelopment #LearningInPublic #JavaScript #BackendDevelopment #TechEducation #OpenSource #100DaysOfCode #CareerInTech
To view or add a comment, sign in
-
🚀 DSA Day 18: Shifting Pointers & Linking Logic! 🔗🧠 Today was less about the theory and more about the logic. Implementing get, insert, and delete really forced me to see the code as a physical chain. The big "Aha!" moment: Realizing the power of O(1) insertions. In an array, adding to the front is a chore; here, you just move the head pointer and you’re done. ⚡️ It’s definitely a game of precision, though. If you don't handle the pointers in the right order—like making the "handshake" before breaking the old link—you lose your entire list to the void. 🕳️ Feeling way more confident with pointer logic now. On to Day 19! ➡️ #Day18 #JavaScript #DSA #LinkedList #CodingJourney #DataStructures #LearningInPublic #WebDev #LogicBuilding
To view or add a comment, sign in
-
-
🚀 Day 6/100 – #100DaysOfDSA Today’s focus was on searching vs sorting and understanding efficiency differences. 🔹 Problems Solved: 1. Binary Search 2. Bubble Sort 💡 Key Learnings: 👉 Problem 1: Binary Search Works only on sorted arrays Divide the search space into half each time 👉 Approach: Find mid index Compare with target Move left or right accordingly ✅ O(log n) Time Complexity ✅ Very efficient for large datasets 👉 Problem 2: Bubble Sort Most people implement Bubble Sort, but today I learned how to optimize it using an early break condition 🚀 👉 Approach: If no swaps happen in a pass, the array is already sorted — so we can stop early instead of continuing unnecessary iterations. ✅O(n) (Optimized with swap flag) 🔥 What I learned today: Choosing the right algorithm matters more than just solving the problem. Consistency continues 💪 Day 6 done! #100DaysOfCode #DSA #BinarySearch #Sorting #LeetCode #ProblemSolving #CodingJourney #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic
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