Ask Question
13 January, 04:35

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. 13 January, 06:30
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers