Illustration
Ascending order
Insertion Sort
Algorithm
Complexity of
Insertion Sort
Best Case O(n)
Worst Case O (n2 )
Average Case O (n ) 2
For both assignment
& comparision
It Reduces
the Amount of
Data Shifting
Complexity of
Selection Sort
Best Case O (n2 )
Worst Case O (n2 )
Average Case O (n2 )
Selection Sort
O(n) for assignment
with a PC of 1.5
O(n2 ) for Comparision
with a PC of 0.5