[Solved] What is this inefficient sorting algorithm with two loops that compares the element at each index with all other elements and swaps if needed?


It is named Exchange sort and is sometimes confused with bubble sort. While Bubble sort compares adjacent elements, Exchange sort compares the first element with all the following elements and swaps if needed. Then it does the same for the second element and so on.

0

solved What is this inefficient sorting algorithm with two loops that compares the element at each index with all other elements and swaps if needed?