Language: EN

libreria-arduino-quicksort

Arduino QuickSort Library

A library that applies the QuickSort algorithm to sort an array in Arduino.

For more information, check out the post QuickSort algorithm in Arduino with QuickSort.

User Manual

The library has two static methods for sorting vectors. Therefore, it is not necessary to instantiate an object.

The library incorporates two static methods for calculating QuickSort in ascending and descending order. It uses templates to work with different types of variables (int, long, float…). The library includes two examples, one for int and one for float.

For ascending sorting, we would use the SortAscending method.

QuickSort<int>::SortAscending(items, initItem, numItems);

While for descending sorting, we would use the SortDescending method.

QuickSort<int>::SortDescending(items, initItem, numItems);

Examples

The QuickSort library includes the following examples to illustrate its use.

  • QuickSortInt: Example of use for integer variables
  • QuickSortFloat: Example of use for float variables

Installation

  • Download the latest version from GitHub
  • Unzip the file
  • Copy to your library folder (usually My Documents\Arduino\libraries)
  • Restart the Arduino IDE

github-full