Simple Sorts

There are several sorts that are relatively easy to code. These are considered to be "simple sorts" and generally have bad run time O(\(n^2)\). In our implementation, we are assuming that we are sorting in ascending order (small to big). Sorting in descending order would typically involve flipping the check in the comparison of the sort. Also note that while all the examples use integer arrays, the general algorithm applies to arrays(and vectors) of all types.

results matching ""

    No results matching ""