Bayer Tree implementation in C

c-algorithms-library

This is implementation of Bayer Trees, sometime referred to as Balanced Tree and normally used for indices of data bases. These routines provide all stuff that is needed to create and destroy; insert, update and delete; load and destroy; search and traverse; check a tree. Sort huge amounts of data by doing a multi-phase sorting on temporary files.

This implementation automatically recognizes if the input data fits completely into memory and then does a in-place sort via quick sort. If you don’t have an ANSI-C compiler, get one (for example GNU-C) or forget about this program (it uses prototyping with ANSI-C style prototypes, so a K&R compiler won’t work). I do *not* support ancient K&R compilers.

Compilating the B-Tree Program

To configure the program, edit the file “jsconfig.h”. Since this is a general configuration file, not all settings may apply to this package. If in doubt, use grep or anything else to find out if a specific configuration symbol is used somewhere.

No default optimization option is used in the Makefile since this is compiler dependent. One has to find out what option produces the best result on the platform. Check the manual of your C-compiler for more information. The variable COPTIMIZE is reserved for optimization. For some systems I have experience with optimization options are given at the beginning of the Makefile, uncomment them for your system.

The file “ErrCodes.c” contains an array of all error messages that will be produced by the library routines, similar to the ANSI “strerror” function.  The library can be configured to load error messages only on demand from the file “Error.txt” which contains the error messages as ASCII text. This saves space in the executable. For that the file “Error.txt” has to be installed globally accessible in a fixed place and the path name of the file has to be defined like

#define CONFIG_ERRMSGFILE "/this/is/the/path/name"

while compiling the package (see “jsconfig.h”).

  B-Tree implementation (48.0 KiB, 19,872 hits)

This program is Copyright – 1993-1995 by Joerg Schoen. Permission to use, copy and distribute this software together with its documentation for any purpose is hereby granted provided that the above copyright notice appears in all copies. No fee must be taken for this package. This software is provided “as is” without expressed or implied warranty.

M. Saqib: Saqib is Master-level Senior Software Engineer with over 14 years of experience in designing and developing large-scale software and web applications. He has more than eight years experience of leading software development teams. Saqib provides consultancy to develop software systems and web services for Fortune 500 companies. He has hands-on experience in C/C++ Java, JavaScript, PHP and .NET Technologies. Saqib owns and write contents on mycplus.com since 2004.
Related Post