Multiple choice technology mainframe

What is the difference between SEARCH and SEARCH ALL?

  1. SEARCH - is a binarysearch. : SEARCH ALL - is serial search & the table must be sorted

  2. SEARCH - is a serial search : SEARCH ALL - is binary search & the table must be sorted

  3. Both are binary search

  4. SEARCH - is a binarysearch & the table is unsorted : SEARCH ALL - is serial search

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

SEARCH is a serial (linear) search that examines table elements sequentially. SEARCH ALL implements a binary search algorithm, which requires the table to be sorted in ascending or descending order. Binary search is much faster for large tables but has the sorting prerequisite.

AI explanation

SEARCH performs a serial (linear) search through a table, checking each element in order and working on unsorted or sorted data alike. SEARCH ALL, by contrast, performs a binary search, which requires the table to be sorted (typically declared with an ASCENDING/DESCENDING KEY clause) since binary search relies on comparing against a midpoint and narrowing the range.