Skip to content

gurusabarishh/python-sorting-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Click here to view the examples

Click here to Download the examples

Bubble sort:

  • Worst and average case time complexcity: O(n^2) Worst case arrive when the list or array is reverse sorted.
  • Best time complexcity: O(n) Best case arrive when the list or array is already sorted.
  • Auxiliary space: O(1)
  • Stable: Yes
  • Method: Exchange
  • Class: comparision sort

Selection sort:

  • Worst,average and Best time complexcity: O(n^2)
  • Auxiliary space: O(1)
  • Stable: No
  • Method: Selection
  • Class: Comparision sort