Empirical Analysis of Quaternary and Binary Search

Authors

  • Muhammad Nauman Saeed Institute of Computer Science, Khwaja Fareed University of Engineering and Information Technology, Rahim Yar Khan, 64200, Pakistan.
  • Mutiullah Jamil Institute of Computer Science, Khwaja Fareed University of Engineering and Information Technology, Rahim Yar Khan, 64200, Pakistan.
  • Zoha Iqbal Department of Artificial Intelligence, The Islamia University of Bahawalpur (IUB), Bahawalpur, 63100, Pakistan.
  • Rimsha Tariq Institute of Computer Science, Khwaja Fareed University of Engineering and Information Technology, Rahim Yar Khan, 64200, Pakistan.
  • Maria Kanwal Department of Information Technology, Institute of Southern Punjab, Multan, Pakistan.
  • Abiha Ejaz Department of Information Technology, The Islamia University of Bahawalpur (IUB), Bahawalpur, 63100, Pakistan.
  • Syed Ali Nawaz Institute of Computer Science, Khwaja Fareed University of Engineering and Information Technology, Rahim Yar Khan, 64200, Pakistan.
  • Abdul Waheed Department of Information Technology, Institute of Southern Punjab, Multan, Pakistan.

Keywords:

Quaternary search, Binary search, Empirical analysis

Abstract

This paper presents an empirical analysis between traditional binary search and quaternary search algorithm in sorted arrays. Binary search algorithm divides the list into two equal halves each time, whereas quaternary search technique divides it into four segments each time. An experiment was conducted with an objective to search the element which is causing the worst time complexity in case of sorted array. It was observed through experiment results that iterative binary search is better than recursive binary search, iterative quaternary search is better than recursive quaternary search and definitely iterative quaternary search is better than iterative binary search. So, the evaluation results prove the best time complexity of binary search algorithm is O(log2 n) and quaternary search algorithm has the best time complexity of O(log4n) and therefore, it’s decided that quaternary search algorithm is better in searching as compared to binary search algorithm.

Downloads

Published

2024-04-01

How to Cite

Muhammad Nauman Saeed, Mutiullah Jamil, Zoha Iqbal, Rimsha Tariq, Maria Kanwal, Abiha Ejaz, Syed Ali Nawaz, & Abdul Waheed. (2024). Empirical Analysis of Quaternary and Binary Search. Journal of Computing & Biomedical Informatics. Retrieved from https://jcbi.org/index.php/Main/article/view/445