Question DSA-CX-0003
EasyWhat is the time complexity of linear search in an array of n elements (worst case)?
- A.
O(log n)
- B.
O(1)
- C.
Show answer and explanation
Answer: D
In the worst case every element must be checked.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Complexity Analysis question
What is the time complexity of linear search in an array of n elements (worst case)?
O(log n)
O(1)
Answer: D
In the worst case every element must be checked.
O(n log n)
O(n)