working cpp soln (and too-slow rb and py solns) to interrupted bubble sort