DIPlib Documentation - ©1995-2017 Quantitative Imaging Group, Delft University of Technology.

QuickSortAnything

Sort data of any type

SYNOPSIS

#include "dip_sort.h"

dip_Error dip_QuickSortAnything ( data, size, compareFunction, swapFunction, tmpData )

FUNCTION

Sorts a block of data (of size size) using the quick sort algorithm. This routine requires the user to write two functions in order to fully implement the sorting procedure. These are SortCompareFunction and SortSwapFunction.

ARGUMENTS

Data typeNameDescription
void *dataData
dip_intsizeSize
dip_SortCompareFunctioncompareFunctionFunction for comparing two data points
dip_SortSwapFunctionswapFunctionFunction for swapping two data points, or copying one to the other
void *tmpDataPointer to a variable of the same type as the data, used as temporary space by some of the algorithms

SEE ALSO

General information about sorting

SortAnything, SortCompareFunction, SortSwapFunction