International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 122 - Number 21 |
Year of Publication: 2015 |
Authors: Obed Appiah, Ezekiel Mensah Martey |
10.5120/21850-5168 |
Obed Appiah, Ezekiel Mensah Martey . Magnetic Bubble Sort Algorithm. International Journal of Computer Applications. 122, 21 ( July 2015), 24-28. DOI=10.5120/21850-5168
Sorting a list of items is one basic task in many applications used on the computer. The term describes the arrangement of a set of items in a certain order to make analysis and processing very easy. Numerous sorting algorithms exist however its efficiency and memory space consumption become a major issue when it has to be implemented. Essentially, programmers select sort algorithms that perform well even as the size of the input data increases. In this study, a new algorithm, Magnetic Bubble Sort Algorithm (MBS) is proposed. The MBS is an enhancement of the bubble sort algorithm which offers a far better performance in the case where redundancies occur in the list. The run time of the MBS depends on the number of distinct values that are found in the list to be sorted. The improved bubble sort algorithm is very simple to analyse, considering the fact that the time complexity of the algorithm depends on two main factors that is the size of list (n) and number of distinct values in the list.