How many interchanges will happen when the sequence of letters of "SORTED" is…

2021

How many interchanges will happen when the sequence of letters of "SORTED" is sorted using bubble sort?

  1. A.

    36

  2. B.

    11

  3. C.

    18

  4. D.

    6

Attempted by 383 students.

Show answer & explanation

Correct answer: B

To determine the number of interchanges in Bubble Sort, we count the total number of inversions in the initial sequence.

An inversion occurs when a larger element appears before a smaller element in the list.

Sequence: S, O, R, T, E, D

S is greater than O, R, E, D (4 inversions).

O is greater than E, D (2 inversions).

R is greater than E, D (2 inversions).

T is greater than E, D (2 inversions).

E is greater than D (1 inversion).

Total interchanges = 4 + 2 + 2 + 2 + 1 = 11.

Explore the full course: Up Lt Grade Assistant Teacher 2025