1. Function Signatures
// Binary Search Tree
void searchCourse(Tree<Course> courses, String courseNumber) {
SNERD
// Searches for a single course and prints information
}
void printAllCourses(Tree<Course> courses) {
// Prints all courses in alphabetical order
}
2. File Loading, Parsing, and Validation
void loadCourses(Tree<Course> bst, String fileName) {
OPEN file fileName FOR reading
IF file cannot be opened THEN
PRINT "Cannot open file " + fileName
RETURN
END IF
CREATE SET allCourseNumbers
// First pass: collect course IDs
WHILE NOT end of file DO
READ line
IF line is empty THEN CONTINUE END IF
SPLIT line by comma INTO tokens
IF size(tokens) < 2 THEN CONTINUE END IF
ADD tokens[0] TO allCourseNumbers
END WHILE
RESET file pointer to beginning
// Second pass: create Course objects and insert into BST
WHILE NOT end of file DO
READ line
IF line is empty THEN CONTINUE END IF
SPLIT line by comma INTO tokens
IF size(tokens) < 2 THEN CONTINUE END IF