Algorithms

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738
Question 17
Medium

An environmental scientist measures the concentrations of a pollutant (in parts per million, ppm) at seven different locations along a river. The recorded levels are:

6.5,1.2,4.8,9.3,2.1,7.6,3.46.5, \quad 1.2, \quad 4.8, \quad 9.3, \quad 2.1, \quad 7.6, \quad 3.46.5,1.2,4.8,9.3,2.1,7.6,3.4

A bubble sort is used to arrange these measurements into ascending order.

State the number of swaps that will be made during the first pass of the algorithm.

[1]

Algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Algorithms