This variable will hold one if there is swapping. Bubble sort is one of the easiest sorting techniques in programming and it is very simple to implement. It gives quite accurate results. Experience. Ltd. All rights Reserved. Inside the for loop, there is another for loop that starts from j=0 all the way to j