Ask 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 when the size of the list doubles from n to 2n, where n is a positive integer.

a) Linear search

b) Binary search

+2
Answers (1)
  1. 19 August, 16:52
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers