KnowledgeBoat Logo
|

Computer Applications

In the bubble sort technique, during each iteration of the inner loop, two adjacent elements are …………… and …………… .

(i) compared
(ii) swapped
(iii) selected
(iv) deleted

  1. (i) and (ii)
  2. (ii) and (iii)
  3. (iii) and (iv)
  4. (ii) and (iv)

Java Arrays

1 Like

Answer

(i) and (ii)

Reason — In the bubble sort technique, during each iteration of the inner loop, two adjacent elements are first compared to check their order. If they are found to be in the wrong order, they are swapped to move the larger element towards the end of the list. This process repeats until the array is sorted.

Answered By

1 Like


Related Questions