Give the correct matching for the following pairs: A. O(log n) 1. Selection…

1998

Give the correct matching for the following pairs:

A. O(log n)     1. Selection sort

B. O(n)         2. Insertion sort

C. O(nlog n)    3. Binary search

D. O(n^2)       4. Merge sort

  1. A.

    A - 3
    B - 1
    C - 2
    D - 4

  2. B.

    A - 3
    B - 2
    C - 4
    D - 1

  3. C.

    A - 1
    B - 3
    C - 4
    D - 2

  4. D.

    A - 1
    B - 4
    C - 3
    D - 2

Attempted by 37 students.

Show answer & explanation

Correct answer: B

Correct complexities:

Binary search → O(log n)3
Insertion sort → O(n) (best case) → 2
Merge sort → O(n log n)4
Selection sort → O(n²)1

Explore the full course: Gate Guidance By Sanchit Sir