Professional Documents
Culture Documents
Sorting Algorithms: Compiled by JN Masi
Sorting Algorithms: Compiled by JN Masi
ALGORITHMS
COMPILED BY JN MASI
Sorting
*Find out which sorting algorithms use internal sorting and which algorithms use external
sorting
Sorting concepts
• Sort Stability
• A sorting method is said to be stable if at the end of the method, identical
elements occur in the same relative order as in the original unsorted set.
• Pass
• During the sorted process, the data is traversed many times. Each
traversal of the data is referred to as a sort pass. In addition, the
characteristic of a sort pass is the placement of one or more elements in a
sorted list
Sorting concepts
• Sort older
• Data can be ordered either in ascending order or in descending order. The
order in which the data is organized, either ascending order or descending
order, is called sort order
• Sort efficiency
• Sort efficiency is a measure of the relative efficiency of a sort. It is usually
an estimate of the number of comparisons and data movement required to
Bubble Sort
value = myList[index]
i = index - 1
while i >= 0:
myList[i+1]=myList[i]
myList[i] = value
i = i -1
else:
break
QUESTIONS???