Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Sorting

Dept. Computer
Science

Sorting algorithms Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Data Structures and Algorithms Selection Sort


Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Dept. Computer Science Quick Sort

Faculty of Computer Science and Engineering Merge Sort

Ho Chi Minh University of Technology, VNU-HCM

Sorting.1
Sorting
Overview
Dept. Computer
Science

1 Sorting concepts

2 Insertion Sort
Straight Insertion Sort Sorting concepts

Insertion Sort
Shell Sort Straight Insertion Sort
Shell Sort

3 Selection Sort Selection Sort


Straight Selection Sort

Straight Selection Sort Exchange Sort


Bubble Sort

4 Exchange Sort Devide-and-Conquer


Quick Sort
Bubble Sort Merge Sort

5 Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.2
Sorting
Course learning outcomes
Dept. Computer
Science

L.O.1 Determine the complexity of simple algorithms


(polynomial time - nested loop - no recursive)
L.O.1.1 Give definition of Big-O notation
L.O.1.2 Determine complexity of simple polynomial algorithms
Sorting concepts

L.O.2 Manipulate basic data structures such as list, tree and graph Insertion Sort
Straight Insertion Sort
L.O.2.1 Describe and present basic data structures such as: array, Shell Sort

linked list, stack, queue, tree, and graph Selection Sort


L.O.2.2 Implement basic methods for each of basic data structures: Straight Selection Sort

array, linked list, stack, queue, tree, and graph Exchange Sort
Bubble Sort

L.O.3 Implement basic sorting and searching algorithms Devide-and-Conquer


Quick Sort
L.O.3.1 Illustrate how searching algorithms work on data structures: Merge Sort

array, linked list, stack, queue, tree, and graph


L.O.3.2 Illustrate how sorting algorithms work on an array
L.O.3.3 Implement necessary methods and proposed algorithms
on a given data structure for problem solving

Sorting.3
Sorting

Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

Sorting concepts Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.4
Sorting
Sorting
Dept. Computer
Science

One of the most important concepts and


common applications in computing. Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.5
Sorting
Sorting
Dept. Computer
Science

Sort stability: data with equal keys maintain


their relative input order in the output. Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.6
Sorting
Sorting
Dept. Computer
Science

Sorting concepts

Insertion Sort

Sort efficiency: a measure of the relative Straight Insertion Sort


Shell Sort

efficiency of a sort = number of comparisons Selection Sort


Straight Selection Sort

+ number of moves. Exchange Sort


Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.7
Sorting
Sorting
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.8
Sorting

Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

Insertion Sort Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.9
Sorting
Straight Insertion Sort
Dept. Computer
Science

• The list is divided into two parts: sorted


and unsorted.
Sorting concepts
• In each pass, the first element of the Insertion Sort
Straight Insertion Sort

unsorted sublist is inserted into the sorted Shell Sort

Selection Sort
sublist. Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.10
Sorting
Straight Insertion Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.11
Sorting
Straight Insertion Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.12
Sorting
Straight Insertion Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.13
Sorting
Straight Insertion Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.14
Sorting
Straight Insertion Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.15
Sorting
Straight Insertion Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.16
Sorting
Straight Insertion Sort
1 Algorithm InsertionSort() Dept. Computer
Science
2 Sorts the contiguous list using straight insertion
sort.

3 if count > 1 then Sorting concepts

4 current = 1 Insertion Sort


Straight Insertion Sort
5 while current < count do Shell Sort

6 temp = data[current] Selection Sort


Straight Selection Sort
7 walker = current - 1 Exchange Sort
8 while walker >= 0 AND temp.key < Bubble Sort

data[walker].key do Devide-and-Conquer
Quick Sort

9 data[walker+1] = data[walker] Merge Sort

10 walker = walker - 1
11 end
12 data[walker+1] = temp
13 current = current + 1
14 end
15 end Sorting.17
Sorting
Shell Sort
Dept. Computer
Science

• Named after its creator Donald L. Shell


(1959).
Sorting concepts
• Given a list of N elements, the list is Insertion Sort
Straight Insertion Sort

divided into K segments (K is called the Shell Sort

Selection Sort
increment). Straight Selection Sort

Exchange Sort
• Each segment contains N/K or more Bubble Sort

elements. Devide-and-Conquer
Quick Sort
Merge Sort

• Segments are dispersed throughout the


list.
• Also is called diminishing-increment sort.

Sorting.18
Sorting
Shell Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.19
Sorting
Shell Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
• For the value of K in each iteration, sort Straight Selection Sort

Exchange Sort
the K segments. Bubble Sort

Devide-and-Conquer
Quick Sort

• After each iteration, K is reduced until it Merge Sort

is 1 in the final iteration.

Sorting.20
Sorting
Example of Shell Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.21
Sorting
Example of Shell Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.22
Sorting
Choosing incremental values
Dept. Computer
Science

• From more of the comparisons, it is better


when we can receive more new Sorting concepts

information. Insertion Sort


Straight Insertion Sort
Shell Sort

Selection Sort
• Incremental values should not be Straight Selection Sort

Exchange Sort
multiples of each other, other wise, the Bubble Sort

same keys compared on one pass would Devide-and-Conquer


Quick Sort
Merge Sort
be compared again at the next.

• The final incremental value must be 1.

Sorting.23
Sorting
Choosing incremental values
Dept. Computer
Science

• Incremental values may be:


1, 4, 13, 40, 121, ...
Sorting concepts
kt = 1 Insertion Sort

ki−1 = 3 ∗ ki + 1 Straight Insertion Sort


Shell Sort

t = | log3 n| − 1 Selection Sort


Straight Selection Sort

Exchange Sort

• or: Bubble Sort

Devide-and-Conquer

1, 3, 7, 15, 31, ... Quick Sort


Merge Sort

kt = 1
ki−1 = 2 ∗ ki + 1
t = | log2 n| − 1

Sorting.24
Sorting
Shell Sort
Dept. Computer
1 Algorithm ShellSort() Science

2 Sorts the contiguous list using Shell sort.

3 k = first_incremental_value Sorting concepts

Insertion Sort
4 while k >= 1 do Straight Insertion Sort
Shell Sort

5 segment = 1 Selection Sort


Straight Selection Sort

6 while segment <= k do Exchange Sort

7 SortSegment(segment) Bubble Sort

Devide-and-Conquer

8 segment = segment + 1 Quick Sort


Merge Sort

9 end
10 k = next_incremental_value
11 end
12 End ShellSort
Sorting.25
Sorting
Shell Sort
1 Algorithm SortSegment(val segment <int>, val k Dept. Computer
Science
<int>)
2 Sorts the segment beginning at segment using
insertion sort, step between elements in the
segment is k. Sorting concepts

Insertion Sort
Straight Insertion Sort
3 current = segment + k Shell Sort

4 while current < count do Selection Sort


Straight Selection Sort
5 temp = data[current] Exchange Sort
6 walker = current - k Bubble Sort

7 while walker >=0 AND temp.key < Devide-and-Conquer


Quick Sort

data[walker].key do Merge Sort

8 data[walker + k] = data[walker]
9 walker = walker - k
10 end
11 data[walker + k] = temp
12 current = current + k
13 end Sorting.26
Sorting
Insertion Sort Efficiency
Dept. Computer
Science

Sorting concepts

• Straight insertion sort: Insertion Sort


Straight Insertion Sort

f (n) = n(n + 1)/2 = O(n2 ) Shell Sort

Selection Sort
Straight Selection Sort

• Shell sort: Exchange Sort


Bubble Sort

O(n1.25 ) (Empirical study) Devide-and-Conquer


Quick Sort
Merge Sort

Sorting.27
Sorting

Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

Selection Sort Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.28
Sorting
Selection Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

In each pass, the smallest/largest item is Selection Sort


Straight Selection Sort

selected and placed in a sorted list. Exchange Sort


Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.29
Sorting
Straight Selection Sort
Dept. Computer
Science
• The list is divided into two parts: sorted
and unsorted.
Sorting concepts
• In each pass, in the unsorted sublist, the Insertion Sort
Straight Insertion Sort

smallest element is selected and Shell Sort

Selection Sort
exchanged with the first element. Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.30
Sorting
Straight Selection Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.31
Sorting
Straight Selection Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.32
Sorting
Straight Selection Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.33
Sorting
Straight Selection Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.34
Sorting
Straight Selection Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.35
Sorting
Straight Selection Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.36
Sorting
Straight Selection Sort
1 Algorithm SelectionSort() Dept. Computer
Science
2 Sorts the contiguous list using straight selection
sort.

3 current = 0 Sorting concepts

4 while current < count - 1 do Insertion Sort


Straight Insertion Sort
5 smallest = current Shell Sort

6 walker = current + 1 Selection Sort


Straight Selection Sort
7 while walker < count do Exchange Sort
8 if data [walker].key < data [smallest].key Bubble Sort

then Devide-and-Conquer
Quick Sort

9 smallest = walker Merge Sort

10 end
11 walker = walker + 1
12 end
13 swap(current, smallest)
14 current = current + 1
15 end Sorting.37
Sorting
Selection Sort Efficiency
Dept. Computer
Science

Sorting concepts

Insertion Sort

• Straight selection sort:


Straight Insertion Sort
Shell Sort

O(n2 )
Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.38
Sorting

Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

Exchange Sort Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.39
Sorting
Exchange Sort
Dept. Computer
Science

Sorting concepts

• In each pass, elements that are out of Insertion Sort


Straight Insertion Sort

order are exchanged, until the entire list is Shell Sort

Selection Sort
sorted. Straight Selection Sort

Exchange Sort
Bubble Sort

• Exchange is extensively used. Devide-and-Conquer


Quick Sort
Merge Sort

Sorting.40
Sorting
Bubble Sort
Dept. Computer
Science

• The list is divided into two parts: sorted


and unsorted.
Sorting concepts
• In each pass, the smallest element is Insertion Sort
Straight Insertion Sort

bubbled from the unsorted sublist and Shell Sort

Selection Sort
moved to the sorted sublist. Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.41
Sorting
Bubble Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.42
Sorting
Bubble Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.43
Sorting
Bubble Sort
1 Algorithm BubbleSort() Dept. Computer
Science
2 Sorts the contiguous list using bubble sort.

3 current = 0
4 flag = False Sorting concepts

5 while current < count AND flag = False do Insertion Sort


Straight Insertion Sort
6 walker = count - 1 Shell Sort

7 flag = True Selection Sort


Straight Selection Sort
8 while walker > current do Exchange Sort
9 if data [walker].key < data [walker-1].key Bubble Sort

then Devide-and-Conquer
Quick Sort

10 flag = False Merge Sort

11 swap(walker, walker - 1)
12 end
13 walker = walker - 1
14 end
15 current = current + 1
16 end Sorting.44
Sorting
Exchange Sort Efficiency
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

• Bubble sort: Shell Sort

Selection Sort

f (n) = n(n + 1)/2 = O(n2 ) Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.45
Sorting

Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

Devide-and-Conquer Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.46
Sorting
Devide-and-Conquer Sort
Dept. Computer
Science

1 Algorithm DevideAndConquer()
2 if the list has length > 1 then Sorting concepts

3 partition the list into lowlist and Insertion Sort


Straight Insertion Sort

highlist Shell Sort

Selection Sort

4 lowlist.DevideAndConquer() Straight Selection Sort

Exchange Sort
5 highlist.DevideAndConquer() Bubble Sort

Devide-and-Conquer
6 combine(lowlist, highlist) Quick Sort
Merge Sort

7 end
8 End DevideAndConquer

Sorting.47
Sorting
Devide-and-Conquer Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Partition Combine Straight Insertion Sort
Shell Sort

Merge Sort easy hard Selection Sort


Straight Selection Sort

Quick Sort hard easy Exchange Sort


Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.48
Sorting
Quick Sort
Dept. Computer
Science

Sorting concepts
1 Algorithm QuickSort() Insertion Sort
Straight Insertion Sort

2 Sorts the contiguous list using quick sort. Shell Sort

Selection Sort
Straight Selection Sort

3 recursiveQuickSort(0, count - 1) Exchange Sort


Bubble Sort

4 End QuickSort Devide-and-Conquer


Quick Sort
Merge Sort

Sorting.49
Sorting
Quick Sort
Dept. Computer
1 Algorithm recursiveQuickSort(val left Science

<int>, val right <int>)


2 Sorts the contiguous list using quick sort.
3 Pre: left and right are valid positions Sorting concepts

Insertion Sort
in the list Straight Insertion Sort
Shell Sort

4 Post: list sorted Selection Sort


Straight Selection Sort

Exchange Sort
5 if left < right then Bubble Sort

Devide-and-Conquer
6 pivot_position = Partition(left, right) Quick Sort
Merge Sort

7 recursiveQuickSort(left,
pivot_position - 1)
8 recursiveQuickSort(pivot_position +
1, right)
9 end Sorting.50
Sorting
Quick Sort
Dept. Computer
Science

Given a pivot value, the partition rearranges Sorting concepts

Insertion Sort
the entries in the list as the following figure: Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.51
Sorting
Quick Sort Efficiency
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

• Quick sort: Shell Sort

Selection Sort

O(nlog2 n) Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.52
Sorting
Merge Sort
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.53
Sorting
Merge Sort
Dept. Computer
Science

Sorting concepts
1 Algorithm MergeSort() Insertion Sort
Straight Insertion Sort

2 Sorts the linked list using merge sort. Shell Sort

Selection Sort
Straight Selection Sort

3 recursiveMergeSort(head) Exchange Sort


Bubble Sort

4 End MergeSort Devide-and-Conquer


Quick Sort
Merge Sort

Sorting.54
Sorting
Merge Sort
Dept. Computer
1 Algorithm recursiveMergeSort(ref sublist Science

<pointer>)
2 Sorts the linked list using recursive merge
Sorting concepts
sort. Insertion Sort
Straight Insertion Sort
Shell Sort

3 if sublist is not NULL AND sublist->link Selection Sort


Straight Selection Sort

is not NULL then Exchange Sort

4 Divide(sublist, second_list) Bubble Sort

Devide-and-Conquer

5 recursiveMergeSort(sublist) Quick Sort


Merge Sort

6 recursiveMergeSort(second_list)
7 Merge(sublist, second_list)
8 end
9 End recursiveMergeSort
Sorting.55
Sorting
Merge Sort
Dept. Computer
Science
1 Algorithm Divide(val sublist <pointer>, ref
second_list <pointer>)
2 Divides the list into two halves.
Sorting concepts
3 midpoint = sublist Insertion Sort
4 position = sublist->link Straight Insertion Sort
Shell Sort
5 while position is not NULL do Selection Sort
6 position = position->link Straight Selection Sort

7 if position is not NULL then Exchange Sort


Bubble Sort

8 midpoint = midpoint->link Devide-and-Conquer


9 position = position->link Quick Sort
Merge Sort

10 end
11 end
12 second_list = midpoint->link
13 midpoint->link = NULL
14 End Divide
Sorting.56
Sorting
Merge two sublists
Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort
Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.57
Sorting
Merge two sublists
1 Algorithm Merge(ref first <pointer>, ref second Dept. Computer
Science
<pointer>)
2 Merges two sorted lists into a sorted list.

3 lastSorted = address of combined Sorting concepts

4 while first is not NULL AND second is not NULL Insertion Sort
Straight Insertion Sort
do Shell Sort

5 if first->data.key <= second->data.key then Selection Sort


Straight Selection Sort
6 lastSorted->link = first Exchange Sort
7 lastSorted = first Bubble Sort

8 first = first->link Devide-and-Conquer


Quick Sort

9 else Merge Sort

10 lastSorted->link = second
11 lastSorted = second
12 second = second->link
13 end
14 end
Sorting.58
Sorting
Merge two sublists
Dept. Computer
Science

1 // ...
Sorting concepts
2 if first is NULL then Insertion Sort
3 lastSorted->link = second Straight Insertion Sort
Shell Sort

4 second = NULL Selection Sort


Straight Selection Sort

5 else Exchange Sort


Bubble Sort

6 lastSorted->link = first Devide-and-Conquer


Quick Sort

7 end Merge Sort

8 first = combined.link
9 End Merge

Sorting.59
Sorting

Dept. Computer
Science

Sorting concepts

Insertion Sort
Straight Insertion Sort

THANK YOU. Shell Sort

Selection Sort
Straight Selection Sort

Exchange Sort
Bubble Sort

Devide-and-Conquer
Quick Sort
Merge Sort

Sorting.60

You might also like