Ask Question
3 September, 08:50

Consider the following list. list = {20, 10, 17, 2, 18, 35, 30, 90, 48, 47}; Suppose that sequential search as discussed in the book is used to determine whether 95 is in list. Exactly how many key comparisons are executed by the sequential search algorithm?

+2
Answers (1)
  1. 3 September, 11:14
    0
    Given the list = {20, 10, 17, 2, 18, 35, 30, 90, 48, 47} and target search is 95, there is a total of 10 key comparisons executed by the sequential search algorithm.

    Explanation:

    Sequential search is also named as linear search which is a searching algorithm that find an element in a list by sequentially matching a target value against the element (key) in the list. Sequential search algorithm begin with comparing the target value with the first key in the list. If it is matched, the index position where the match is found will be returned. If not, the comparison will be repeated for the next key until a match is found.

    In the worst case where there is no match found in the list, the total number of key comparisons gone through by the search algorithm is equal to size of the list, n. For example, given the list {20, 10, 17, 2, 18, 35, 30, 90, 48, 47} with a size of 10 (as it has 10 keys), since 95 is not in the list, the sequential search on the list will go through n-times which is 10 times key comparisons before it can report there is no match from the list.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Consider the following list. list = {20, 10, 17, 2, 18, 35, 30, 90, 48, 47}; Suppose that sequential search as discussed in the book is ...” 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