UT/UT_QuickSort.h File Reference

#include "UT_API.h"
#include <stddef.h>
#include "UT_IntArray.h"

Go to the source code of this file.

Classes

class  UT_QuickSort

Functions

UT_API void UTquickSelect (void *base, size_t nel, size_t nth, size_t width, int(*compar)(const void *, const void *))
UT_API void UTquickSelect (int *base, size_t nel, size_t nth, int(*compar)(int, int))


Function Documentation

UT_API void UTquickSelect ( int *  base,
size_t  nel,
size_t  nth,
int(*)(int, int)  compar 
)

UTquickSelect will find the nth element of the list. A partial sort will be performed to sort until the nth element is actually in the correct place. This doesn't usually require a full sort.

This was written in the spirit of qsort() and thus has room for optimization (see quick-sort class below).

UT_API void UTquickSelect ( void *  base,
size_t  nel,
size_t  nth,
size_t  width,
int(*)(const void *, const void *)  compar 
)

UTquickSelect will find the nth element of the list. A partial sort will be performed to sort until the nth element is actually in the correct place. This doesn't usually require a full sort.

This was written in the spirit of qsort() and thus has room for optimization (see quick-sort class below).


Generated on Thu May 24 00:09:05 2012 for HDK by  doxygen 1.5.9