DEV Community

Jeyaprasad R
Jeyaprasad R

Posted on

My Journey Through Sorting Algorithms

Over the past few sessions, I got hands-on experience with different sorting algorithms, and honestly, it felt like slowly uncovering how computers actually think when organizing data. What started as simple concepts gradually turned into deeper insights about efficiency, memory usage, and problem-solving strategies.


đź“… Day 07: Bubble Sort & Selection Sort

This was my starting point with sorting algorithms, and it really helped me build a strong foundation.

🔹 Bubble Sort

Bubble Sort works by repeatedly comparing adjacent elements and swapping them if they’re in the wrong order.

At first, it felt very intuitive—almost like manually sorting numbers step by step, the way we might do it on paper.

đź’ˇ What I understood:

  • Easy to implement and visualize
  • Not efficient for large datasets (O(n²))
  • More useful for learning than real-world applications

What stood out to me was how simple logic can still solve a problem, even if it’s not the most efficient way.


🔹 Selection Sort

Selection Sort takes a slightly different approach—it repeatedly selects the smallest element and places it in its correct position.

đź’ˇ My takeaway:

  • Performs fewer swaps compared to Bubble Sort
  • Still not efficient for large inputs (O(n²))
  • Helped me understand how selecting the “best” element step-by-step works

This made me realize that even small changes in approach can lead to noticeable differences in how an algorithm behaves.


đź“… Day 08: Insertion Sort

Insertion Sort felt the most relatable to me—like arranging playing cards in your hand.

Instead of unnecessary swapping, it builds a sorted portion step by step by placing each element exactly where it belongs.

đź’ˇ What stood out:

  • Works really well for small or nearly sorted datasets
  • Worst-case time complexity is still O(n²)
  • More efficient in practice than Bubble and Selection Sort

This was the moment I started appreciating that real-world performance isn’t just about theory—it’s about context.


đź“… Day 09: Merge Sort + Real-World Connection

This session felt like leveling up.

🔹 Merge Sort

Merge Sort introduced me to the idea of divide and conquer, which honestly changed how I think about solving problems.

  • Break the array into smaller parts
  • Sort each part individually
  • Merge them back together in order

đź’ˇ My understanding:

  • Much faster and more efficient (O(n log n))
  • Performs consistently regardless of input
  • Requires extra memory

What really clicked for me here was the idea that breaking a big problem into smaller, manageable pieces can make it much easier to solve efficiently.


🌍 Connecting to the Real World

One thing I found really interesting was how these concepts relate to real-world systems.

Even though we were learning sorting algorithms, the discussion made me realize that similar logic is used in applications we use daily—like collaborative tools where data needs to be updated, organized, and synchronized efficiently.

It made the whole topic feel much more practical and less “just theoretical.”


đź§  Final Reflection

These three days completely changed how I look at sorting and problem-solving:

  • Day 07 gave me the basics and intuition
  • Day 08 showed me smarter and more practical approaches
  • Day 09 introduced efficiency and a new way of thinking (divide and conquer)

What I take away from this experience is that sorting isn’t just about arranging numbers—it’s about choosing the right strategy based on the situation.

And now, whenever I see an unsorted list, I don’t just think about fixing it—I think about how I would fix it, and which algorithm I would choose.

Top comments (0)