So, I need to make a binary tree, except each node needs to hold multiple data types...
My instructor told me to use structures, but I am still lost as to how to put all this data into the tree.
struct record{
long int student_id; char lastname[12]; char firstname[12];
char home_address[40]; long int tele_num;
};
int main(int argc, char *argv[]){
ifstream infile("lab7_input.txt");
ofstream outfile("lab7_output.txt");
BST<long int> myTree;
record students[10];
for (int i = 0; i <= 10; i++ ){
infile>>students[i].student_id>>students[i].lastname>>students[i].firstname>>students[i].home_address>>students[i].tele_num;
myTree.insert(students[i].student_id);
}
long int* a=myTree.search(students[1].student_id);
cout << *a;
...
}
Any ideas on how to do this? I omitted the classes and their functions but I think you get the idea.