very nice. why to you use the flag variable? you do not use it after the sorting.
jonathan archer
1
Hi Jonathan,
In Bubble Sort, I always make sure that Left Element is greater than the Right Element. If it succeeds, I make the flag = True, or if it remains, False, hence the array is already sorted.