• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..16-May-201737

avl.cH A D18-Jul-201613.6 KiB

avl.hH A D18-Jul-20166.6 KiB

avlsort.cH A D18-Jul-20163.3 KiB

build/H16-May-20174

COPYINGH A D18-Jul-201618 KiB

GNUmakefileH A D18-Jul-20162 KiB

MakefileH A D18-Jul-2016123

READMEH A D18-Jul-20163.1 KiB

setdiff.cH A D18-Jul-20162.1 KiB

README

1========================================================================
2
3WHAT IS AVLTREE?
4
5AVLTree is a small implementation of AVL trees for the C programming
6language.  It is distributed under the Library GNU Public License (see
7the file LICENSE for details).
8
9This library does the basic stuff. It allows for inserts, searches, and
10deletes in O(log n) time. It also allows the tree to be used as a linked
11indexable list (search/insert functions cannot be used in that case).
12
13If you find a bug, you should mail Wessel Dankers <wsl@nl.linux.org>,
14who produced this version of the library and therefore is to blame.
15
16The original author is Michael H. Buselli <cosine@cosine.org>, who can
17be reached at the following address:
18
19	Michael H. Buselli
20	4334 N. Hazel St. #515
21	Chicago, IL  60613-1456
22
23========================================================================
24
25COMPILING THE LIBRARY
26
27There is a Makefile included in the distribution.
28
29========================================================================
30
31USING THE LIBRARIES
32
33There are no real usage documents yet. Look at avl.h (you need to
34include these headers in your programs to use the library) to see what
35functions and structures are available. As a small example:
36
37	#define BUFSIZE 8192
38
39	int main(void) {
40		char *buf[BUFSIZE];
41		AVLTree *tree;
42		AVLTree *node;
43
44		tree = avl_alloc_tree((avl_compare_t)strcmp, (avl_freeitem_t)free);
45
46		while(fgets(buf, BUFSIZE, stdin))
47			avl_insert(tree, strdup(buf));
48
49		for(node = tree->head; node; node = node->next)
50			printf("%s", node->item);
51
52		avl_free_tree(tree, free);
53	}
54
55A real implementation would check the return values of avl_alloc_tree,
56avl_insert and strdup of course.
57
58========================================================================
59
60HISTORY
61
62Version 0.1.0 (alpha):
63	This is the initial alpha version of AVLTree.  It's already fully
64	functional for many applications, including the one that I developed it
65	for.  I've only tested it on my Linux 2.0.35/glibc2 system, so I have no
66	idea what it will do anywhere else so far.  Let me know if you have good
67	results or bad if you try a platform that I don't mention above.
68
69    This version is considered alpha because it does not yet contain
70	all of the features that I plan for version 1.0.0.  It should not
71	contain any bugs as it is.
72
73Version 0.2.0 2000-11-28 Wessel Dankers <wsl@nl.linux.org>
74	Modifications to support fast traversal and accessing by index.
75	The tree is generalized to allow arbitrary comparison functions.
76	Fixed bug: when deleting, in some cases rebalancing would not occur
77
78Version 0.3.0 2001-01-07 Wessel Dankers <wsl@nl.linux.org>
79	Tree can now be balanced on count or depth (but depth works better).
80	Fixed bug: balancing on count now is done correctly.
81
82Version 0.3.1 2001-07-17 Wessel Dankers <wsl@nl.linux.org>
83	Node initialization is moved to make matters a bit more robust
84
85Version 0.3.4 2002-06-11 Wessel Dankers <wsl@fruit.eu.org>
86	Fixed a bug in the node counting.
87
88Version 0.3.5 2002-11-15 Wessel Dankers <wsl@fruit.eu.org>
89	Added avl_node_fixup() and avl_clear_tree().
90	Removed obsolete files from source tree.
91
92========================================================================
93