Computer Science, asked by devyadv189, 11 months ago

What is the time complexity of searching for an element in an unsorted array?

Answers

Answered by arjun7774
0

The complexity is O(logn). Binary Search does not work for "un-Sorted" lists. For these lists just do a straight search starting from the first element; this gives a complexity of O(n). If you were to sort the array with MergeSort or any other O(nlogn) algorithm then the complexity would be O(nlogn).

Similar questions