Quiz Complete, well Done!
What is the main disadvantage of linear search?
What is the time complexity of linear search when searching for the last element of an array?
What is linear search?
What is the purpose of the return statement in a linear search function?
In a linear search, the items are checked **
** until the target item is found.
The linear search algorithm starts at the **
** of the list and checks each item in turn until the target item is found.
List
Big O notation
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 time complexity of linear search?
What is the worst-case time complexity of linear search?
What is the best-case time complexity of linear search?
What is the worst-case time complexity of linear search?
Boolean
Index
What is the worst-case time complexity of linear search?
What is the space complexity of linear search?
Unordered
Average-case scenario
Linear search can be easily implemented using a **
** loop to iterate through the items in the list.