InterviewSolution
Saved Bookmarks
| 1. |
Consider the problem of computing min-max in an unsorted array where min and max are minimum and maximum elements of array. Algorithm A1 can compute min-max in a1 comparisons without divide and conquer. Algorithm A2 can compute min-max in a2 comparisons by scanning the array linearly. What could be the relation between a1 and a2 considering the worst case scenarios?(A) a1 < a2(B) a1 > a2(C) a1 = a2(D) Depends on the input |
| Answer» | |