Dec 062017
 
Self Balancing Fully Populated Binary Tree Container Class. C++ source code.
File SBBTREE.ZIP from The Programmer’s Corner in
Category C++ Source Code
Self Balancing Fully Populated Binary Tree Container Class. C++ source code.
File Name File Size Zip Size Zip Type
README.TXT 2005 978 deflated
TREE.CPP 31926 6256 deflated
TREE.HPP 11024 3121 deflated

Download File SBBTREE.ZIP Here

Contents of the README.TXT file




This archive contains the files:
TREE.CPP
TREE.HPP

They implement a Self Balancing Fully Populated Binary Tree Container Class.

What does this mean?

A Container Class is a Object Oriented class whose main purpose is to keep
other objects in some sort of order. In this case, the objects must be
derrived from Sortable, and are kept in a Binary Tree. This implementation
is patterened after the container classes that are a part of Borland
International's class library. I think I have all the methods implemented,
but there may be a few that I have missed. I leave these as exercises for
the students. 😉

The greatest advantage of the binary tree is the speed with which you can
retrieve any individual member.

Fully Populated is the term that I apply, and it might not be correct, to
this Binary Tree, as each node in the tree has a pointer to a added object.
There are some Binary Trees that only store objects in the leaf nodes.

Self Balancing is an attempt to address what is typically the weakest
attribute to most binary tree implementations. If you add sequential
members to a binary tree, when it adds them in order you end up with a
doubly link list, and search speeds that are slightly worse than a doubly
linked list. This binary tree performs a "balancing act" that corrects
the double linked list problem, and creates a true binary tree, so that the
search times are kept optimal.

This code started out as a regular C implementation of such a tree, and I
have adapted this code to be a C++ container class, much in the style of the
Borland International container classes.

I hereby release all this source code to the public domain with no strings
attached. All I ask is that if you find a bug, or make some improovments,
that you make an effort to upload them to GEnie, and that you maintain this
"no strings attached" policy.

Erik Ch. Ohrnberger
UUNet: uucp!umich!edsews!edstip!{erik,ohrnb}
GEnie: E.OHRNBERGER


 December 6, 2017  Add comments

Leave a Reply