What is the worst case time complexity of a linear search algorithm, if array is already sorted?
O(n log n)
O(n log n^2)
Whether it is sorted or unsorted, for linear search it doesn't matter because linear search always search item by item. so to find if an element is available in array or not, we have to check all the elements. so total time complexity will be n number of comparisons. so it is O(n).
Back To Top