# 'C' Source Code Examples

### A numeric calculator: starting point for complex calculator

calculat.c

### Prime number generators

primes.c

eratothenes.c

### Some Example Programs demonstrating pointers to pointers

ptrptr.c

stack.c

myprintf.c

### Multiplication program demonstrating relative inefficiency of an iterative algorithm

slowmult.c

### Multiplication program demonstrating relative efficiency of a recursive algorithm

fastmult.c

### Merge sort program demonstrating a recursive sorting algorithm

mergsrt.c

### Chris Noble's Knuth binary tree program refactored by Richard Kay

tree.c

### Chris Noble's original binary tree program

cntree.c

### Richard Kay's AVL balanced binary tree program

avltree.c

### Program demonstrating heap priority queue implementation.

heap1.c

### General sort first program demonstrating function passing algorithm

gensort.c

### General sort second program demonstrating function passing algorithm

gensort2.c

### Program to create random values in a file suitable for sort testing

mkrands.c

### Example random text data as created by mkrands.c

rands.txt

### Program to use random values for generating passwords

pwgen.c

### Program to use random values for creating a value for PI.

randpi.c

In order to use pwgen.c and randpi.c programs, a file random.bin
(not supplied) needs to be created first containing a random stream
of bits.

### Program to generate a mininum spanning tree from a graph
to plan the shortest route between 2 places.

minspan.c

In order to use minspan.c the following input data may be
used: vertices.txt and
edges.txt