Linked List Cycle and Palindrome Solutions with Smart Pointers

🚀 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

Explore content categories