Comparison of Bubble Sort and Selection
Comparison of Bubble Sort and Selection
Abstract— In computer science the ordering of data in a list is The technology used in e-commerce including
one of the most researched topics. In algorithm design, efficient public-key cryptography and digital signatures are
searching and sorting is necessary. Hence, comparison based based on numerical algorithms.
methods have been developed to solve these problems. In this
study, we compare the two most commonly used sorting Algorithms and data structures have utter importance for
algorithms, bubble sort and selection sort with their enhanced
permanently growing areas of engineering, economy, science
versions.
and daily life. The searching and ranking algorithms in search
Keywords— Enhanced selection sort, enhanced bubble sort, engines and the pattern matching algorithms crucial for
reading the human genome are only a few spectacular
selection sort, bubble sort.
examples how algorithms can change our life (Peter Sanders,
Dorothea Wagner, Karlsruhe Institute of Technology 2011) .
I. INTRODUCTION In this study two sorting algorithms, Bubble Sort and
Selection Sort are presented with their enhanced versions.
The use of data structures and algorithms has become an
Moreover, a thorough comparison has been shown between
essential part of any computer application since the age of
these two sorting algorithms.
computing. The data stored in several common data structures
such as arrays, linked lists, queues, stacks, binary trees and II. LITERATURE REVIEW
hash tables require the use of sorting algorithms, to organize
the stored data in a certain order. Many algorithmic techniques
A. Bubble Sort
have been developed overtime for solving computational
problems by designing new complex algorithms and Also known as sinking sort is a way of listing data by
implementing them efficiently [1]. repeatedly going through the list in steps called iterations. In
each step, adjacent pair of data is compared and swapped if
Some of the practical applications of algorithms include:
they are not in the correct order. In this way the smaller
The Human Genome Project has identified all the elements, rise to the top of the list as if it’s a bubble and the
100,000 genes in human DNA through the use of larger elements move towards the bottom end of the list. The
sophisticated algorithms for finding out the sequence size of the list decreases by a decrement of one from n to 2.
of 3 billion chemical base pairs that make up human This has two outer and inner loops. The outer loop finds the
DNA. maximum or minimum number for replacing in the list. The
The quick retrieval and access of large amounts of inner loop processes the selected list by the outer loop for
data on the internet has been done with the use of finding and replacing the smallest or largest number ([4], [6]).
algorithms.
The diagram below shows how the elements of an array of
size 5 get reordered in the first iteration.
the start of the list move to the top slowly. This has led to
these types of elements being named rabbits and turtles,
respectively [2, 20].
VI. CONCLUSION
References
[1] Aho A., Hopcroft J., and Ullman J., The Design and
Analysis of Computer Algorithms, Addison Wesley, 1974.
[2] Bell D., “The Principles of Sorting,” Computer Journal of
the Association for Computing Machinery, vol. 1, no. 2,
pp. 71-77, 1958.
[3] Deitel H. and Deitel P., C++ How to Program, Prentice
Hall, 2001.
[4] en.wikipedia.org/wiki/Bubble_sort
[5] en.wikipedia.org/wiki/Selection_sort
[6] algorithmist.com/index.php/Bubble_sort
[7] cs.stackexchange.com/questions/13106/why-is-selection-
sort-faster-than-bubble-sort
[8] C++ Programming From problem analysis to program
design Fifth Edition DS Malik pg 569
[9] Enhancement of Selection, Bubble and Insertion Sorting
Algorithm May 25,2014 Research Journal Comsats
[10] An Enhancement of Major Sorting Algorithms Jehad
Alnihoud and Rami Mansi, Sep1 2008, Department of
Computer Science, Al al-Bayt University, Jordarn, Pg. 55