#include <math.h>#include <stdlib.h>#include "quicksort.h"
Functions | |
| void | swap (IndexedList a[], int i, int j) |
| Swap elements i and j in the indexed list. | |
| int | Random (int i, int j) |
| void | quicksort (IndexedList a[], int left, int right) |
| void quicksort | ( | IndexedList | a[], | |
| int | left, | |||
| int | right | |||
| ) |
Implementation of standard libray C qsort function to sort the values in the indexed list while keeping track of their original indicies.
References quicksort(), Random(), and swap().
Referenced by prepare_detections_list(), and quicksort().
| int Random | ( | int | i, | |
| int | j | |||
| ) |
Randomiser used by quicksort to avoid the worst case perfomance where the input array is already sorted (which could happen in our data.
Referenced by quicksort().
| void swap | ( | IndexedList | a[], | |
| int | i, | |||
| int | j | |||
| ) |
Swap elements i and j in the indexed list.
References IndexedList::index, and IndexedList::value.
Referenced by quicksort().
1.6.3