Suppose you want to find the largest entry in an unsorted array of n entries. Algorithm A searches the entire array sequentially and records the largest entry seen so far. Algorithm B sorts the array into descending order and then reports the array’s first entry as the largest. Compare the time efficiency of the two approaches.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here