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,11The 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?
8,14,22,5,19,118, \quad 14, \quad 22, \quad 5, \quad 19, \quad 118,14,22,5,19,11
14,22,8,19,11,514, \quad 22, \quad 8, \quad 19, \quad 11, \quad 514,22,8,19,11,5
8,14,5,19,11,228, \quad 14, \quad 5, \quad 19, \quad 11, \quad 228,14,5,19,11,22
8,5,11,14,22,198, \quad 5, \quad 11, \quad 14, \quad 22, \quad 198,5,11,14,22,19
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.