FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

Β© 2026 FlareStart. All rights reserved.

Back to articles
Different Sorting Methodologies in Python – Complete Guide
How-ToProgramming Languages

Different Sorting Methodologies in Python – Complete Guide

via Dev.to TutorialManoj Kumar5h ago

πŸ”„ Different Sorting Methodologies in Python – Complete Guide Hi All, In this blog, I’ll explain the different sorting algorithms I learned, including their working, code, and complexity . πŸ“Œ What is Sorting? Sorting is the process of arranging elements in a specific order: Ascending (small β†’ large) Descending (large β†’ small) 🧠 1. Bubble Sort πŸ’‘ Idea: Repeatedly compare adjacent elements and swap if needed. πŸ’» Code: def bubble_sort ( arr ): n = len ( arr ) for i in range ( n ): for j in range ( 0 , n - i - 1 ): if arr [ j ] > arr [ j + 1 ]: arr [ j ], arr [ j + 1 ] = arr [ j + 1 ], arr [ j ] return arr ⚑ Complexity: Time: O(nΒ²) Space: O(1) 🧠 2. Selection Sort πŸ’‘ Idea: Find the minimum element and place it at the beginning. πŸ’» Code: def selection_sort ( arr ): n = len ( arr ) for i in range ( n ): min_idx = i for j in range ( i + 1 , n ): if arr [ j ] < arr [ min_idx ]: min_idx = j arr [ i ], arr [ min_idx ] = arr [ min_idx ], arr [ i ] return arr ⚑ Complexity: Time: O(nΒ²) Space: O(1) 🧠 3. In

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
0 views

Related Articles

I Haven’t Written Real Code in 3 Months. My Products Still Ship.
How-To

I Haven’t Written Real Code in 3 Months. My Products Still Ship.

Medium Programming β€’ 37m ago

My Learning Experience with Sorting Algorithms
How-To

My Learning Experience with Sorting Algorithms

Dev.to Tutorial β€’ 2h ago

Stop Building Projects. Start Building Systems.
How-To

Stop Building Projects. Start Building Systems.

Medium Programming β€’ 2h ago

I Learned More in 3 Months Than 3 Years (The System That Actually Works)
How-To

I Learned More in 3 Months Than 3 Years (The System That Actually Works)

Medium Programming β€’ 3h ago

CA 12 - Next Permutation
How-To

CA 12 - Next Permutation

Dev.to β€’ 3h ago

Discover More Articles