Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Complete BINARY SEARCH TREE in C Programming Language to maintain student records (***MIN 5 students with information from User Input Initially***). ***User must

Write a Complete BINARY SEARCH TREE in C Programming Language to maintain student records (***MIN 5 students with information from User Input Initially***).

***User must initially be asked to enter the number of students they would like to input (min 5) before any insertion or deletion and then enter their information*********

***************************************** YOU MUST CONSTRUCT A BST (L

Your program should take the following inputs:

1. Student ID (any value between 1000 to 1100) NO DUPLICATES

2. Student first name (max. 20 characters)

3. Student last name, (max. 20 characters)

4. Student scores (float/double), eg. 85.4 ****CONSTRUCT A BST WITH STUDENT SCORES*********

5. Zip code (may be a string) You have to create a structure Student with above information. Then create a Binary Search Tree where each node in the BST contains a Student. Note1: Student ID (left child) < Student ID (parent) < Student ID (right) Your program should be able to take records of a minimum of 5 students ***INITIALIZED BY USER, User must enter the number of sudents initially and enter the information******. After taking the records, you should provide 7 functionalities to the user.

1. Print records prints records of all students.

2. Add a new record - take a new record from the user for a new student. Create a node for the new student and add it to the BST (Student ID va lue must satisfy the BST property as provided in Note1).

3. Delete record(s) to delete a record, ask for the last name of the student from the user. If there are multiple students with same last name, you must delete all of their records ( you have to delete corresponding nodes and adjust the BST accordingly).

4. Search by Zip code prints records of all students with a given zip code.

5. Search by score range take two scores max, min; and then print records of all students who have scores betw een [max, min] (inclusive).

6. Find the median score compute the median score and print it. Also, print how many students are above this median score (do not forget to sort the values in the nodes to compute median) .

7. Exit the program terminate on a specific input from the user. Let that specific input be an integer of value 0.

You should print the record in the following format: Student ID: ID1 , First Name: firstname1, Last Name: lastname1, Score: score1, Zipcode: code1 Student ID: ID2 , First Name: firstname2, Last Name: lastname2, Score: score2, Zipcode: code2

***************************************** YOU MUST CONSTRUCT A BST (L

****** User must initially be asked to enter the number of students they would like to input (min 5) before any insertion or deletion and then enter their information****************

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago