Quiz Complete, well Done!
What is the difference between linear search and binary search?
Comparison
Linear search checks every item in the list and has a worst-case **
** of O(n).
Element
Sequential Search
Unordered
In which scenario would linear search be a better choice than binary search?
What is the time complexity of linear search when searching for the last element of an array?
Average-case scenario
The linear search algorithm starts at the **
** of the list and checks each item in turn until the target item is found.
How does linear search process an unsorted list?
Which of the following is a drawback of linear search?
In a linear search, the worst-case scenario occurs when the target item is **
** or not in the list.
Which of the following is an example of when linear search might be used?
In a linear search, the average time complexity is **
** of O(n), where n is the number of items in the list.
What is the best-case time complexity of linear search?
Linear Search
In which type of data does linear search perform best?
What is the main disadvantage of linear search?
Worst-case scenario