Okay, I finally got most of my records program to work. It saves an array
of records to a file, where-in I can reload all the records. I can also delete
and reuse records. Now, here comes the fun part of my project: I have to
use binary trees in it. The teacher wants the program complex. So, I was
wondering how to attempt this. The whole point of a binary tree is to cut
down search time, so I need to save it in a tree like form. And since I
am saving it to a file, I think arrays would be much easier to use.
I do have some source code with binary trees, but all of them use
pointers, which I cannot save to a regular file. So, what I need is
help or source code for the following:
1. Binary Tree that can sort records. I have one that can sort
numbers, but I need one that can sort records. It also needs
to add the record to the tree every time I enter a new record.
2. Can save the binary tree of records in an array format that can
be loaded for immediate search. I was thinking of just having
a list of records and then add them to the tree before the search,
but that would increase execution time and defeat the purpose
of a binary tree. If a binary tree that uses pointers can be saved
to a file, I'm take a look at that too. It doesn't have to be arrays,
I just that it would be easier using them.
3. Have complete deleting routines: leaf, root, and middle. Deleting
a leaf is pretty easy I guess. It's the root and middle that makes it
a pain in the butt.
Because I am asking a lot, I am giving 1100 points to the person that
helps me the most.
My rough source code for my project is at http://home.onestop.net/aleinss/DATA2.PAS
You may take a look at it and offer suggestions.