Match the following algorithm with its average complexity. Algorithm: I. Binary search; II. Quick sort; III. Linear search; IV. Selection sort
Match the following algorithm with its average complexity.
Algorithm: I. Binary search; II. Quick sort; III. Linear search; IV. Selection sort
Average Complexity: 1. O(n²); 2. O(log n); 3. O(n log n); 4. O(n)
Show answerHide answer
Correct answer: (A) I – 2; II – 3; III – 4; IV – 1