Sail E0 Webinar
Question
What is the best case and worst case complexity of ordered linear search?
Options:
A .  O(nlogn), O(logn)
B .  O(logn), O(nlogn)
C .  O(n), O(1)
D .  O(1), O(n)
Answer: Option D


Although ordered linear search is better than unordered when the element is not present in the array, the best and worst cases still remain the same, with the key element being found at first position or at last position.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers