Question:
Give a way to optimise a bubble sort algotihm
Author: Will ParkerAnswer:
The inner loop takes into account that after each pass the last non sorted index place is sorted so there's no need to loop to that point again Also a recognistion (through a variable called swapped maybe) of when the algrothm has sorted the problem so no unnecessary additional passing through is done
0 / 5 (0 ratings)
1 answer(s) in total
Author
Will Parker