Optimized Bubble Sort (Java)

I would like to know how else I can optimize bubble sort so that it overlooks elements that have already been sorted, even after the first pass. Eg. [4, 2, 3, 1, 5, 6] –> [2, 3, 1, **4, 5, 6**] …

How can I bubble sort this?

In this program I just wanted to bubble sort the ArrayList words. So far I used the Collections.sort and it has placed all the lines in the text file alphabetically. However, I want to implement a …