Guidance on Binary Search Tree for a Database
807603Dec 16 2007 — edited Dec 16 2007Hey everybody. Im trying to use a linked binary search tree to create a student database and just need some help figuring out how I should implement it.
The student records (ID, first name, last name, year (sophomore etc.)) are to be stored in an array and will be sorted by student name and student ID. So there will be two BST's, one sorted by name, one sorted by ID. The database should insert, remove, find a student, and list the entire contents of the database.
I already have the BST classes and the nodes. I'm just confused as how to set up the database. I am going to need a Student class, a database class, and a driver? The student class will just define the student record which is the ID, first name, last name, and year. Is that all it needs? And then the driver will call on a database class to call on all my search trees? Is that how it should work? If so, what should my database class look like methods-wise? If not, any advice is greatly appreciated. Thanks in advance.