• edited by
12,582 views
35 35 votes

Give the correct matching for the following pairs: $$\begin{array}{|ll|ll|}\hline \text{(A)} & \text{$O (\log n)$} & \text{(P)} & \text{Selection} \\\hline  \text{(B)} & \text{$O (n)$} & \text{(Q)}& \text{Insertion sort} \\\hline   \text{(C)}& \text{$O (n \log n)$} & \text{(R)}  & \text{Binary search} \\\hline  \text{(D)} & \text{$O (n^2)$} &\text{(S)}  & \text{Merge sort}  \\\hline \end{array}$$

  1. $\text{A-R  B-P  C-Q  D-S}$

  2. $\text{A-R  B-P  C-S  D-Q}$

  3. $\text{A-P  B-R  C-S  D-Q}$

  4. $\text{A-P  B-S  C-R  D-Q}$

3 Answers

Best answer
45 45 votes

Here we are talking about the worst case time complexities of the given algorithms. Selection actually refers to selection algorithm and not selection sort.

  • Selection$: O(n)$
  • Insertion sort $: O(n^2)$
  • Binary search $:O(\log n)$
  • Merge sort $:O(n \log n)$

$\text{A} -\text{R}\quad \text{B}-\text{P}\quad \text{C}-\text{S}\quad \text{D}-\text{Q}.$

Correct Answer: $B$

• selected by
16 16 votes

A) O(logN) -> Binary Search. No other option Matches -> R . Option C & D eliminated.

C) O(nlogn) => Merge sort, even in best worst or any case. -> S  Option A eliminated.

It seems to me that all options are wrong here. But I would go with

Option B) A-R  B-P  C-S  D-Q

D => Q This is okay.

B=> P It is okay if we just have selection. Selection sort is O(N2)

6 6 votes

here

        A) (Ologn)-> Binary search

        B) O(n)   -> max no of swap in selection sort in worst case.

       C)  O(nlogn) -> marge sort 

       D)  O(n^2)  -> No of swap (moment)  in insertion sort in worst case

hance B is correct answer...........

Answer:
Position:
Show:

Related questions

10 10 votes
6 6 answers
4.0k
4.0k views
Arjun asked Feb 27, 2025
3,998 views
Suppose that insertion sort is applied to the array $[1,3,5,7,9,11, x, 15,13]$ and it takes exactly two swaps to sort the array. Select all possible values of $x$.$10$$12...
1 1 vote
1 answers 1 answer
825
825 views
Bikram asked Oct 4, 2016
825 views
Match the following two columns given in a table:1. Randomized quick sorta. $\Theta(n+k)$2. Insertion sortb. $\Theta\left(n^2\right)$3. selection sortc. $\Theta(n)$4. Buc...
31 31 votes
2 answers 2 answers
13.7k
13.7k views
Kathleen asked Sep 25, 2014
13,722 views
Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?Dynamic programmingBacktrackingGreedyDivide and Conqu...
49 49 votes
10 answers 10 answers
22.6k
22.6k views
Kathleen asked Sep 25, 2014
22,636 views
Which normal form is considered adequate for normal relational database design?$2NF$$5NF$$4NF$$3NF$