Algorithms and Data Structures · Senior · Question 61 of 75

What is the lower bound for finding an element in an unsorted array, and why?

Explanation

An adversary argument: if an algorithm skips a position, the target could be there. Hashing helps only after an O(n) preprocessing step that builds the table.

Further reading

Problem with a question

Algorithms and Data Structures · Senior · question 61

Test yourself

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

Take this quiz