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

Classes | Defines | Functions

smoothsort.c File Reference

Smoothsort implementation. More...

#include <stdlib.h>
#include <sofia-sip/su_config.h>
#include "config.h"
#include <sofia-sip/heap.h>
#include <assert.h>
#include <stdio.h>
#include <sys/types.h>
Include dependency graph for smoothsort.c:

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)

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.

Generated by  Doxygen 1.6.0   Back to index