Skip to main contentSkip to solution

Match the LIST-I with LIST-II

LIST-ILIST-II
A.Bubble sortI.Repeatedly compare adjacent elements
B.Insertion sortII.Constant time algorithms
C.Algorithm with nested loopIII.Quadratic time algorithms
D.Algorithms with no loopsIV.Places elements in sorted list one by one

Solution

✅ Correct Option: 3
List IList II
(A) Bubble sort(I) Repeatedly compare adjacent elements
(B) Insertion sort(IV) Places elements in sorted list one by one
(C) Algorithm with nested loop(III) Quadratic time algorithms
(D) Algorithms with no loops(II) Constant time algorithms

Bubble sort swaps adjacent elements that are out of order, pass after pass. Insertion sort takes each element and inserts it into its correct place in the already sorted part.

A nested loop runs about n×nn \times n times, which gives O(n2)O(n^2) (quadratic) time. With no loops, the number of steps does not depend on input size, so the time is O(1)O(1) (constant).


Option 4: bubble sort and insertion sort are both quadratic in the worst case, which makes A-III tempting. But the match for bubble sort is its adjacent-comparison method, and the "nested loop" item is what maps to quadratic time.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question