Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve it ASAP solve it quickly to get you thumbs up directly We are going to create a student records database. A student record

image text in transcribed

image text in transcribed

please solve it ASAP solve it quickly to get you thumbs up directly

We are going to create a student records database. A student record has the following structure: A unique student ID. The ID is a positive integer. A last name. A first name. A class standing of First year, "Second year", "Third year", "Fourth year", or "Graduate". Address. The college (Science, Engineering, Law, and Economics) The records will be sorted by student name, and by student ID. We are going to use AVL trees to sort the records. This will require maintaining two AVL trees, one sorted by name, the other sorted by ID. Data Structures The student records will be stored in a simple linked list. The linked list will not be sorted. The complete student record will only be stored in the linked list. There will be two AVL trees, one for each sorting order. An AVL tree is a binary search tree with a height balancing property. For every node in the tree, the height of the node's left subtree and right subtree differ by at most 1. The AVL trees will not contain any of the student information directly. Instead, they will contain a pointer to the location of the student's information in the linked list. These data structures should be part of a single large data structure (class). This data structure should have the following operations. Insert: insert a student record into the database. Insert will be passed a student ID, a name, a class standing, address, and the college. If a record with that student ID already exists output the message insert error: "ID # already exists". Otherwise, insert will add the student record to the end of the linked list, and will also insert records into the two AVL trees. . FindID: find a student record by ID. This will use the AVL tree that sorts the records by ID. . Findname: find a student record by name. This will use the AVL tree that sorts the records by name. . Delete: delete a student record. delete is passed a student ID. The student record will be removed from the linked list. We will use lazy deletion in the AVL trees. If the record does not exist, output the message delete error: "ID # does not exist". Driver You will write a driver with which to test and use your database. The driver will get commands from your interface. The commands are: Read data from file: Read the original data from an input file. Insert id, firstname, lastname, and standing: Insert the student record into the database. Find ID id: Find the student record and print it to standard output. The record should be printed in the following form: ID: 19111111 Name: Ahmad Ali Standing: Second year Address: Jerusalem College: Engineering Find name firstname, lastname: Find all the student records with the given name. Print out the records using the format from find, with a blank line between each record. delete id: Delete the student record from the database. Years: Number of students based on years. The record should be printed in the following form: First year: 30 Second year: 27 Third year: 19 Fourth year: 15 Graduate: 52 Colleges: Number of students based on colleges. Science:40 Engineering: 42 Law: 31 Economics:30 print: Print out the linked list, and print out the AVL trees using an in-order traversal. Write to file: Print the final data on the file, sorted by firstname, lastname

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

What is cultural tourism and why is it growing?

Answered: 1 week ago