Sorting/Longs/figure4-qsort.c File Reference

Generate Small example(s) for Quicksort. Several test cases for Quicksort. Used in debug mode (step by step) when manually generating the figures in the book. More...

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "dot.h"

Functions

void do_qsort (int id, long *ar, int(*cmp)(const long a, const long b), int left, int right)
 externally defined implementation.
int cmp (const long a, const long b)
 Comparison function for longs.
void debug (long *a, int n)
 Useful debugging code.
int main (int argc, char **argv)


Detailed Description

Generate Small example(s) for Quicksort. Several test cases for Quicksort. Used in debug mode (step by step) when manually generating the figures in the book.

Author:
George Heineman
Date:
6/15/08

Function Documentation

int cmp ( const long  a,
const long  b 
)

Comparison function for longs.

void debug ( long *  a,
int  n 
)

Useful debugging code.

void do_qsort ( int  id,
long *  ar,
int(*)(const long a, const long b cmp,
int  left,
int  right 
)

externally defined implementation.

Can't be 'qsort' since that is a standard unix library call.

int main ( int  argc,
char **  argv 
)

Algorithm Development Kit 1.0