TEKsystems Interview Question

How bubble sort algorithm works?