Sorting Algorithm( comparison based and non comparison based).pdf
habibumuhammed143
6 views
31 slides
Oct 23, 2025
Slide 1 of 31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
About This Presentation
I summarised the comparison based and non comparison based
Size: 3.82 MB
Language: en
Added: Oct 23, 2025
Slides: 31 pages
Slide Content
NAME : HABIBU MUHAMMED.
DEPT. : COMPUTER ENGINEERING.
COURSE : DESIGN ALGORITHMS.
DATE : 09/10/2025
PURPOSE : ASSIGNMENT 1.
WHAT IS SORTING ALGORITHMS?
ANSWER
What is a Sorting Algorithm?
A
an order. For example, a given array [10, 20, 5, 2] becomes [2, 5, 10, 20]
after sorting in increasing order and becomes [20, 10, 5, 2] after sorting in
decreasing order.
Classification of Sorting Algorithms
•
•
•
+
•
•
•
•
•
•
•
Comparison Table
Algorith
m
Time
Complexi
ty (Best)
Time
Complexi
ty
(Average
)
Time
Complexi
ty
(Worst)
Space
Complexi
ty
Stable?
In-
Place
?
Bubble
Sort
O(n)O(n²)O(n²)O(1)YesYes
Selectio
n Sort
O(n²)O(n²)O(n²)O(1)NoYes
Insertio
n Sort
O(n)O(n²)O(n²)O(1)YesYes
Merge
Sort
O(n log n)O(n log n)O(n log n)O(n)YesNo
QuickSo
rt
O(n log n)O(n log n)O(n²)O(log n)
Typical
ly No
Yes*
Heap
Sort
O(n log n)O(n log n)O(n log n)O(1)NoYes
Countin
g Sort
O(n + k)O(n + k)O(n + k)O(n + k)YesNo
Radix
Sort
O(d(n +
k))
O(d(n +
k))
O(d(n +
k))
O(n + k)YesNo