[General boards] [Winter 2019 courses] [Fall 2018 courses] [Summer 2018 courses] [Older or newer terms]

Dec 2012 Part F Q3


Has anyone figured this one out? Clearly it’s a loop iteration but that’s all I’ve got.


The solutions I found online said “It’s a single iteration of the inner loop of bubble sort.” which seems crazy specific to just know but yeah :confused:


Yeah I also thought it was bubble sort. Bubble sort involves swapping adjacent elements if they’re in the wrong order and the program works by calculating the difference between them and if it’s negative, we swap (negative = they are in the wrong order)