Algorithms and Data Structures · Junior · Question 30 of 75

What is linear search?

Explanation

Linear search works on any array, sorted or not, and costs O(n) in the worst case. indexOf, includes and find all do linear search.

Further reading

Problem with a question

Algorithms and Data Structures · Junior · question 30

Test yourself

Take the Algorithms and Data Structures · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz