quicksort.c File Reference

#include <math.h>
#include <stdlib.h>
#include "quicksort.h"
Include dependency graph for quicksort.c:


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)

Detailed Description

Ian Bond, IfA, University of Edinburgh

Function Documentation

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().

Generated on Mon Oct 4 10:39:53 2010 for WsaTools by  doxygen 1.6.3