This is basically a variation of bubble-sort. This algorithm is divided into two phases- Odd and Even Phase. The algorithm runs until the array elements are sorted and in each iteration two phases occurs- Odd and Even Phases.
In the odd phase, we perform a bubble sort on odd indexed elements and in the even phase, we perform a bubble sort on even indexed elements.
-9 2 10 34
Please refer complete article on Odd-Even Sort / Brick Sort for more details!
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Java Program for Odd-Even Sort / Brick Sort
- Odd-Even Sort / Brick Sort
- Odd Even Transposition Sort / Brick Sort using pthreads
- Comparison among Bubble Sort, Selection Sort and Insertion Sort
- Program to sort an array of strings using Selection Sort
- Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists?
- Bucket Sort To Sort an Array with Negative Numbers
- Serial Sort v/s Parallel Sort in Java
- Insertion sort to sort even and odd positioned elements in different orders
- Quick Sort vs Merge Sort
- Sort an Array which contain 1 to N values in O(N) using Cycle Sort
- Add elements in start to sort the array | Variation of Stalin Sort
- Merge Sort vs. Insertion Sort
- sort() vs. partial_sort() vs. nth_element() + sort() in C++ STL
- Sort all even numbers in ascending order and then sort all odd numbers in descending order
- C Program for Bubble Sort on Linked List
- C Program to Sort an array of names or strings
- C++ program for Sorting Dates using Selection Sort
- C Program for Selection Sort
- C Program for Bubble Sort