Multi-key binary search and the related performance

  • Authors:
  • Ahmed Tarek

  • Affiliations:
  • Department of Math and Computer Science, California University of Pennsylvania, California, PA

  • Venue:
  • MATH'08 Proceedings of the American Conference on Applied Mathematics
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Binary Search is efficient due to it's logarithmic time complexity. It is used to identify the position of a key in a sorted list. Often, computer applications require searching for two to more different keys at the same execution. In this paper, a hybrid algorithm to perform the binary search with 2 to m different keys (m is an integer greater than or equal to 2) in a sorted list of elements is proposed. An m-key version of the proposed algorithm requires considering (2m + 1) different cases. Correctness proof of the algorithm is established using induction on the list size, n. Time complexity of the proposed algorithm is a function of 2 variables, namely, the number of keys, m and the list size, n, and is given as, O(mlog(n)) in both the worst and the average cases. The best case complexity is linear, which is O(m). Performance of 2 and 3-key versions is compared with the classical single key version. Possible key index combinations with the multi-key search strategies are also explored.