Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please give me a solution in C language of the question. foc splisting 's a folons: 'A' repesents a studeat. agnetar. Input format - Ibe
Please give me a solution in C language of the question.
foc splisting 's a folons: 'A' repesents a studeat. agnetar. Input format - Ibe inpe: concame a charzecer 'e' foloned ts un tateger 's's' t in, s' to displag che comet med simbut hat uf tin greap ' 2 . charactens representeg the beanci name ibeth uppereaso and jeceross are oondedecd the aim. Lransh). Durput furmint: - The merpir if ancj of nect cmman' shaul' be prated o a erpuneo inn - Hoc inpar lises startha x'th the chauece 't' roloned be u lutezef ' N2,3, peinte in - Eo inpar lins etartimg with on 'ntegoc 'in' E N, it bolkead by tro darocters, pries the Hrinl 1. Sisrapin Tipeat: 1 Vrewn Bazditife 1H Al B210nicsi 21 2. As part of MNTIP scholarship programme, first name, last name, gender, date_of_bith, department and CGPA of fourth semester students of NITC are gathered. The scholarship is for four semesters from fifth semester onwards. The record information is organized using a hash table with the help of a separate chaining technique. In separate chaining, the size of the hash table is 26 , such that to insert a record into the hash table, ASCII value of the first character of first name starts with A points to index 0, ASCII value of the first character of first name starts with B points to index 1 and so on. The resulting location contains a pointer to a Binary Search Tree(BST), in this case the root of a binary search tree (BST), where all elements with the same index are stored. Since a BST requires that its nodes be comparable to each other, we need to define an order among the records being stored in the BST lexiographically. The key value of each node in BST is student's (firstname, lastname) pair, assuming it is unique to a student. The update function updates the CGPA of the corresponding key. The insert/update/delete function should return the number of nodes touched in the BST (except the current node) while performing the given operation. The location function returns index-bstsequence, where index represents the index of the key in the hash table, and bstsequence represents the sequence of L/R steps taken on the binary search tree of all records whose index is the same. Input Format: - For insertion - The first line of the input should be the character 'i' where 'i' denotes insertion. - The second line of the input is a string representing the first name followed by a string representing the last name followed by a single character either ' M ' or 'F' representing the gender followed by a string in the format DD-MM-YYYY representing the date of birth followed by a string of length four representing the department and a floating point number representing the CGPA separated by single space in between them. - For updation - The first line of the input should be the character ' u ' where 'u' denotes updation. - The second line of the input is a string representing the first name, a string representing the last name and a floating point number representing the updated CGPA separated by single space in between them. - For location and deletion - The first line of the input should be the character either ' l ', or ' d ' where 'l' denotes location and 'd' denotes deletion. - The second line of the input is a string representing the first name and a string representing the last name separated by single space in between them. Input Output Format: - The output (if any) of each command should be printed on a separate line. - The insert/update/delete function should return the number of nodes touched in the BST (except the current node) while performing the given operation. - The update/delete function returns - 1 , if key is not present. - The location function returns index-bstsequence, index represents the index of the key in the hash table, and bstsequence represents the sequence of L/R steps taken on the binary search tree of all records whose index is the same. The location function returns 1, if key is not present
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started