Multiple choice technology mainframe

What kind of search is used in SEARCH ALL?

  1. Serial Search

  2. Binary search

  3. Tree Search

  4. SQL Search

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

COBOL's SEARCH ALL verb implements a binary search algorithm. Binary search requires the table to be sorted and repeatedly divides the search interval in half, achieving O(log n) time complexity.

AI explanation

SEARCH ALL in COBOL performs a binary search, which requires the table to be sorted on the key (declared via the ASCENDING/DESCENDING KEY clause in the OCCURS definition). This is faster than the serial search done by a plain SEARCH, which checks entries one at a time regardless of order.