Rakesh kr.’s Post

🚀 Day 7/100 – #100DaysOfDSA One week in! 🎯 Today I focused on understanding basic sorting algorithms and how they work internally. 🔹 Problems Covered: 1. Selection Sort 2. Insertion Sort 💡 Key Learnings: 👉 Selection Sort Repeatedly find the minimum element from the unsorted part Place it at the correct position ✅ Time Complexity: O(n²) ✅ Space Complexity: O(1) (In-place) 👉 Insertion Sort Build the sorted array one element at a time Insert each element into its correct position ✅ Time Complexity: Best: O(n) (already sorted) Average/Worst: O(n²) ✅ Space Complexity: O(1) 🔥 What I learned today: Both algorithms are simple and useful for learning, but Insertion Sort performs better for partially sorted arrays, while Selection Sort always takes the same time. Understanding these basics helps in mastering advanced sorting algorithms later 🚀 Week 1 complete ✅ Consistency continues! #100DaysOfCode #DSA #Sorting #SelectionSort #InsertionSort #CodingJourney #ProblemSolving #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic

To view or add a comment, sign in

Explore content categories