DistDir
Functions
Sorting

Functions

void mergeSort (int *arr, int l, int r)
 Sort array. More...
 
void mergeSort_with_idx (int *arr, int *arr_idx, int l, int r)
 Sort array and an associated index list. More...
 
void mergeSort_with_idx2 (int *arr, int *arr_idx1, int *arr_idx2, int l, int r)
 Sort array and two associated index lists. More...
 
void quickSort (int *arr, int l, int h)
 Sort array. More...
 
void quickSort_with_idx (int *arr, int *arr_idx, int l, int h)
 Sort array and its array of indices. More...
 
void quickSort_with_idx2 (int *arr, int *arr_idx1, int *arr_idx2, int l, int h)
 Sort array and two associated index lists. More...
 
void timSort (int *arr, int l, int r)
 Sort array. More...
 
void timSort_with_idx (int *arr, int *arr_idx, int l, int r)
 Sort array and an associated index list. More...
 
void timSort_with_idx2 (int *arr, int *arr_idx1, int *arr_idx2, int l, int r)
 Sort array and two associated index lists. More...
 

Detailed Description

Sorting algorithms used internally by DistDir library

Function Documentation

◆ mergeSort()

void mergeSort ( int *  arr,
int  l,
int  r 
)

Sort array.

Sort array using mergesort algorithm

Parameters
[in]arrArray to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ mergeSort_with_idx()

void mergeSort_with_idx ( int *  arr,
int *  arr_idx,
int  l,
int  r 
)

Sort array and an associated index list.

Sort array and an associated index list using mergesort algorithm

Parameters
[in]arrArray to be sorted
[in]arr_idxIndex list array to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ mergeSort_with_idx2()

void mergeSort_with_idx2 ( int *  arr,
int *  arr_idx1,
int *  arr_idx2,
int  l,
int  r 
)

Sort array and two associated index lists.

Sort array and two associated index lists using mergesort algorithm

Parameters
[in]arrArray to be sorted
[in]arr_idx1First Index list array to be sorted
[in]arr_idx2Second Index list array to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ quickSort()

void quickSort ( int *  arr,
int  l,
int  h 
)

Sort array.

Sort array using quicksort algorithm

Parameters
[in]arrArray to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ quickSort_with_idx()

void quickSort_with_idx ( int *  arr,
int *  arr_idx,
int  l,
int  h 
)

Sort array and its array of indices.

Sort array and an associated index list using quicksort algorithm

Parameters
[in,out]arrArray to be sorted
[in,out]arr_idxArray of indices following the sorting of arr
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ quickSort_with_idx2()

void quickSort_with_idx2 ( int *  arr,
int *  arr_idx1,
int *  arr_idx2,
int  l,
int  h 
)

Sort array and two associated index lists.

Sort array and two associated index lists using quicksort algorithm

Parameters
[in,out]arrArray to be sorted
[in,out]arr_idx1First Index list array to be sorted
[in,out]arr_idx2Second Index list array to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ timSort()

void timSort ( int *  arr,
int  l,
int  r 
)

Sort array.

Sort array using timsort algorithm using subarrays of size 32

Parameters
[in,out]arrArray to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ timSort_with_idx()

void timSort_with_idx ( int *  arr,
int *  arr_idx,
int  l,
int  r 
)

Sort array and an associated index list.

Sort array and an associated index list using timsort algorithm with subarrays of size 32

Parameters
[in,out]arrArray to be sorted
[in,out]arr_idxIndex list array to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted

◆ timSort_with_idx2()

void timSort_with_idx2 ( int *  arr,
int *  arr_idx1,
int *  arr_idx2,
int  l,
int  r 
)

Sort array and two associated index lists.

Sort array and two associated index lists using timsort algorithm with subarrays of size 32

Parameters
[in,out]arrArray to be sorted
[in,out]arr_idx1First index list array to be sorted
[in,out]arr_idx2Second index list array to be sorted
[in]lFirst index of the array to be sorted
[in]rLast index of the array to be sorted