Bubble Sort and Optimized Bubble Sort Algorithms in Python