Bubble Sort Algorithm Visualization

Bubble sort visualization
Bubble sort visualization

Bubble sort is a relatively simple sorting algorithm. It works by repeatedly fixing sort order between adjacent elements. Bubble sort is very popular yet not suitable for sorting large datasets since it has an average and worst case complexity of O(n2). Today I am sharing bubble sort algorithm visualization to get better understanding of it.

View Project in GitHub

In the following video, you could see the bubble sorting in action. The dataset (array to be sorted) is generated using random functions and it has a size of 500. The visualization is implemented using JavaFX.

This visualization is implemented with the help of Chart component in JavaFX. I have used a javafx.scene.chart.BarChart. You can learn more about using JavaFX chart from this link.