Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

smoothsort.c File Reference

Detailed Description

Smoothsort implementation.

Smoothsort is a in-place sorting algorithm with performance of O(NlogN) in worst case and O(n) in best case.

See also:
"Smoothsort, an alternative for sorting in-situ", E.D. Dijkstra, EWD796a, <http://www.enterag.ch/hartwig/order/smoothsort.pdf&gt;.
Pekka Pessi <Pekka.Pessi@nokia.com>

Definition in file smoothsort.c.

#include "config.h"
#include <assert.h>
#include <stdio.h>
#include <sys/types.h>

Go to the source code of this file.


struct  array
struct  stretch


#define DEBUG(x)   ((void)0)


static void semitrinkle (array const *array, size_t r, stretch s)
static void sift (array const *array, size_t r, stretch s)
static size_t stretch_down (stretch s[1], unsigned bit)
static size_t stretch_up (stretch s[1])
void su_smoothsort (void *base, size_t r, size_t N, int(*less)(void *m, size_t a, size_t b), void(*swap)(void *m, size_t a, size_t b))
static void trinkle (array const *array, size_t r, stretch s)

Generated by  Doxygen 1.6.0   Back to index