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
Practise OCR GCSE Computer Science Searching and sorting algorithms with exam-style questions for GCSE Computer Science. 36 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.