QAProgramming › Regardless of the algorithm being used, a search through an array is always performed ________.
Q

Regardless of the algorithm being used, a search through an array is always performed ________.

A. beginning with the middle element

B. from highest to lowest element

C. from lowest to highest element

D. using a binary search

E. None of these

A

Answer: D. using a binary search

In searching for a particular member of an array, the array is searched thoroughly until the member is found. The linear search or sequential search is a very simple algorithm that uses a loop to sequentially go through an array starting with the first element. it works by comparison. It compares every element and tries to find matches with the element being searched for. It only stops either when the element being searched for has been found or on getting to the end of the array. The algorithm will only get to the end of the array if the searched value is not in the array.

3 years ago
305 Views