Skip to content

v0.3 - add 3-argument variants to accept user-defined sorting functions

Compare
Choose a tag to compare
@bxparks bxparks released this 23 Aug 18:04
· 13 commits to master since this release
55c9204
  • v0.3 (2021-08-23)
    • Add 3-argument versions of each sorting function which accepts a lambda
      expression or function pointer that evalutes the general "less-than"
      comparison between 2 elements in the array.
      • Can be used to implement any sorting criteria, e.g. reverse sort, or
        sorting using compound keys.
      • Reimplement 2-argument versions of each sorting function to simply
        call the 3-argument versions using a default "less-than" function
        to give simple ascending order.
      • The quickSortXxx() algorithms do not optimize well, probably due
        to the recursive function call, so the 2-argument version is
        duplicated from the 3-argument version.
      • Add examples/CompoundSortingDemo to illustrate the 3-argument
        sorting functions to sort by (name, score) pair.
      • No changes observed to flash memory consumption or CPU execution
        times.