Question: Write a program to process data for Computer Engineering Students. The data should be loaded from a text file containing the following information for each
Write a program to process data for Computer Engineering Students. The data should be loaded
from a text file containing the following information for each student:
Student ID Student Name, Surname, and Grade in the Data Structure course. As the following:
Your Node definition should be as
follow:
struct node
int ID;
char Nane;
char Surnane;
int Grade;
node left;
; ;
node right;
Sudent Graden tet Notepad
The tan Fornat Vew Help
Ahlas Saleen
All Mabeel
and Hasr
Nadla Sameer
Your program initially reads the file and creates a Binary Search Tree BST in which each node
maintains a record of the file. The BST is arranged in terms of Student ID As the following:
You should implement
void buildTreeFromFilechar filename
You should implement an insert function based on ID
void insert node root, int ID const char Name, const char
Surname, int Grade
If the ID already exists in the tree. you should update the value
You should implement a search function. This function search for an ID in the
binary search tree and return the associated value.
node search node root, int ID
You should implement a delete function. This function delete a student from the BST
depending on ID
void delete node root, int ID
You should implement a function to print BST inorder.
void printinorder node root
You should implement a function to count the number of the students that grades lie
within the range
You should implement a function to print the data of the students that have the top
grades.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
