Quiz Complete, well Done!
Best-case scenario
Which of the following is a drawback of linear search?
In a linear search, if the target item is not found, the algorithm **
** through every item in the list before stopping.
Complexity
Efficiency
Runtime
What is the space complexity of linear search?
List
Worst-case scenario
What is a linear search?
What is the main advantage of linear search?
A linear search algorithm is an algorithm that looks at every
in a list or an array until it finds the target value.
What is the worst-case time complexity of linear search?
Sequential Search
O(n)
What is the difference between linear search and binary search?
Linear search can be easily implemented using a **
** loop to iterate through the items in the list.
In a linear search, the items are checked **
** until the target item is found.
What is the purpose of the return statement in a linear search function?
Linear time complexity