Ask Question
18 October, 16:27

Describe how the number of comparisons used in the worst case changes when these algorithms are used to search for an element of a list when the size of the list doubles from n to 2n, where n is a positive integer.

a) Linear search

b) Binary search

+4
Answers (1)
  1. 18 October, 19:29
    0
    The linear search changes from O (1) to O (n), and binary search changes from O (1) to O (log n). Where n is an integer.

    Explanation:

    The linear algorithm transverse through a list of items until the target value is found. When a search is conducted, the algorithm moves through the unordered list, one item at a time, denoted as O (1). But when the list size is increased, it is gets to the worse case of O (n) with n as the integer of the increased value.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Describe how the number of comparisons used in the worst case changes when these algorithms are used to search for an element of a list ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers