International Journal of Applied Science and Technology

ISSN 2221-0997 (Print), 2221-1004 (Online) 10.30845/ijast

Simulating Binary Search Technique Using Different Sorting Algorithms
B. G. Balogun, J. S. Sadiku

In this study, the binary search method is simulated using twenty different data sets. The data are all numeral and generated randomly. The objective is to find out which sorting method should be used if there is need to apply binary search method on unsorted data. Another objective is to establish the extent to which binary search is efficient. To achieve these objectives a C# code is developed. The code generates the required random numbers, it also sorts them using bubble sort, insertion sort, and quick sort techniques before applying the binary search algorithm. The internal clock of the computer is set to monitor the time durations of the computations. The results show that except for small data sets both the bubble and insertion sort methods should not be employed. Rather the quick sort method should be used to sort large data sets. This agrees with the existing asymptotic analysis of the complexities of these sorting methods. However, the insertion sort performs better than does bubble sort. It is also observed that linear search may be preferred to binary search if searching is to be carried out on unsorted data.

Full Text: PDF