Skip to content

Course home

Searching and sorting algorithms

Searching and sorting algorithms

EasyMedium
12345678910111213141516171819
Question 19

A warehouse operative is using a bubble sort algorithm to arrange six packages into ascending order of weight. The initial weights of the packages, in kilograms, are:

14,8,22,5,19,11 14, \quad 8, \quad 22, \quad 5, \quad 19, \quad 11 14,8,22,5,19,11

The operative performs the first complete pass of the bubble sort from left to right. What is the state of the list of weights at the end of this first pass?

A

8,14,22,5,19,118, \quad 14, \quad 22, \quad 5, \quad 19, \quad 118,14,22,5,19,11

B

14,22,8,19,11,514, \quad 22, \quad 8, \quad 19, \quad 11, \quad 514,22,8,19,11,5

C

8,14,5,19,11,228, \quad 14, \quad 5, \quad 19, \quad 11, \quad 228,14,5,19,11,22

D

8,5,11,14,22,198, \quad 5, \quad 11, \quad 14, \quad 22, \quad 198,5,11,14,22,19

Markscheme

Searching and sorting algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Searching and sorting algorithms

36 exam-style questions on OCR GCSE Computer Science Searching and sorting algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank