A java question:What is the running time of the fastest algorithm to determine whether an given array of size n is sorted or not? Thanka a lot!
Theta(n)
Prove is straightforward, as you can never tell if the array is sorted without scanning each element in the array at least once.