i've tried numerous code attempts(all seem to crash the machine),
can anyone explain in easy to understand terms how to balance a binary search tree
the basic explanation of my program is that i've got a load of CDS and would like to store them to a file and load them up again when needed, the CDS are placed within a binary tree and gets sorted according to the artist name, the rest of the details are CD title, number of tracks, and tracklist
heres my structure for the tree
struct tracks
{
char SongTitle[40];
};
struct datatype
{
char artist[40]; //key field
char title[40];
int numberTracks;
tracks SongList[24];
};
struct PTRnode
{
datatype data;
PTRnode *left;
PTRnode *right;
};
any help whatsoever will be much appreciated, please be as basic as possible as we haven't covered this topic in class yet and i dont want to wait until then
thanx korbitz