Visualization of sorting algorithms in C++ using SFML graphics library
Bubble sort is an algorithm that compares the adjacent elements and swaps their positions if they are not in the intended order. The order can be ascending or descending.- Bubble Sort
- Completxity: 0(n^2)
- Bubble Sort Code
- Time Taken: 7876 Microseconds (7.876 Milliseconds)
- GIF SPEED NOT TO SCALE
Selection sort is an algorithm that selects the smallest element from an unsorted list in each iteration and places that element at the beginning of the unsorted list.
- Selection Sort
- Completxity: 0(n^2)
- Selection Sort Code
- Time Taken: 7994 Microseconds (7.994 Milliseconds)
- Usually quicker than Bubble Sort
- GIF SPEED NOT TO SCALE
Insertion sort is a sorting algorithm that places an unsorted element at its suitable place in each iteration.
- Insertion Sort
- Completxity: 0(n^2)
- Insertion Sort Code
- Time Taken: 7984 Microseconds (7.984 Milliseconds)
- GIF SPEED NOT TO SCALE