Odd-Even Sort Visualization


Odd-Even Sort - Sorting Algorithm Visualizer

DESCRIPTION

Odd-Even Sort, also known as **Brick Sort**, is a **comparison-based sorting algorithm** that works by repeatedly performing two passes: one for odd-indexed elements and another for even-indexed elements.

The algorithm iterates through the list, comparing and swapping adjacent elements at odd and even indices separately. It continues this process until no swaps are needed, ensuring that the array is sorted.

Odd-Even Sort has a **worst-case and average time complexity of O(n²)**, making it inefficient for large datasets. However, for nearly sorted data, its complexity can be as low as **O(n)**.

One advantage of Odd-Even Sort is that it is **parallelizable**, meaning it can be implemented efficiently in multi-threaded environments. Additionally, it is a **stable sorting algorithm** and works **in-place**, requiring no extra memory.

While Odd-Even Sort is not widely used in real-world applications, it is useful for educational purposes, parallel computing scenarios, and small datasets where simplicity is preferred.

COMPLEXITY

Average Complexity O(n²)
Best Case O(n)
Worst Case O(n²)
Space Complexity O(1)
Odd-Even Sort Visualization

Odd-Even SORT IMPLEMENTATION

                    
                
Odd-Even Sort Visualization