Skip to main content
QUICK REVIEW

[Paper Review] Modified Binary Search Algorithm

Ankit Chadha, Rishikesh Misal|arXiv (Cornell University)|Jun 6, 2014
Metaheuristic Optimization Algorithms ResearchComputer Science1 references14 citations
TL;DR

This paper proposes a modified binary search algorithm that enhances worst-case performance by checking the input element against the first, last, and middle elements of the sorted array at each iteration. By validating whether the target lies within the current subarray range, the algorithm reduces unnecessary comparisons, leading to faster convergence in degenerate cases while maintaining O(log n) time complexity with improved practical efficiency.

ABSTRACT

This paper proposes a modification to the traditional binary search algorithm in which it checks the presence of the input element with the middle element of the given set of elements at each iteration. Modified binary search algorithm optimizes the worst case of the binary search algorithm by comparing the input element with the first & last element of the data set along with the middle element and also checks the input number belongs to the range of numbers present in the given data set at each iteration there by reducing the time taken by the worst cases of binary search algorithm.

Motivation & Objective

  • To address the inefficiency of traditional binary search in worst-case scenarios where comparisons remain high despite logarithmic time complexity.
  • To reduce the number of comparisons in degenerate cases by incorporating range validation at each iteration.
  • To maintain the O(log n) time complexity while improving practical performance through early termination checks.
  • To enhance search efficiency by validating whether the target value lies within the current subarray bounds before proceeding.
  • To provide a practical optimization that improves real-world performance without altering the asymptotic complexity of binary search.

Proposed method

  • At each iteration, the algorithm compares the target value with the first, last, and middle elements of the current subarray.
  • It checks whether the target value lies within the range defined by the first and last elements of the current subarray.
  • If the target is outside the range, the algorithm immediately returns 'not found' without further processing.
  • If the target is within the range, the algorithm proceeds with standard binary search logic, updating the search boundaries based on comparison with the middle element.
  • The algorithm maintains the same divide-and-conquer structure as classical binary search but adds a preliminary range validation step.
  • The modification is applied recursively or iteratively, depending on implementation, with no change to the overall algorithmic framework.

Experimental results

Research questions

  • RQ1Can range validation using first and last elements reduce the number of comparisons in worst-case binary search scenarios?
  • RQ2Does checking whether the target lies within the current subarray bounds improve practical performance without increasing time complexity?
  • RQ3Can early termination due to range checks lead to faster convergence in degenerate input cases?
  • RQ4How does the modified algorithm compare to classical binary search in terms of average and worst-case performance?
  • RQ5Is the added logic for range checks justified by measurable performance gains in real-world search workloads?

Key findings

  • The modified algorithm reduces the number of comparisons in worst-case scenarios by enabling early termination when the target is outside the current subarray range.
  • The algorithm maintains O(log n) time complexity, ensuring theoretical efficiency is preserved.
  • By validating range membership at each step, the algorithm avoids unnecessary comparisons in cases where the target is not present in the current segment.
  • The optimization is effective in practice, particularly for inputs where the target is not in the array or is far from the middle elements.
  • The method introduces minimal overhead while providing measurable performance improvements in edge cases.
  • The approach is compatible with both iterative and recursive implementations of binary search.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.