Question
you will build a linked list data structure for storing and organizing a student list that can be iterated in name-alphabetical order (sorted based on
you will build a linked list data structure for storing and organizing a student list that can be iterated in name-alphabetical order (sorted based on the names of the students), in surname-alphabetical order (sorted based on the surnames of the students), and in numeric order (sorted based on the student IDs). The students with their names, surnames, and IDs will be read from an input file (i.e., students.txt) and they will be organized by using a singly linked list data structure in the program. Each student struct in your linked list should contain a char pointer, as name; a char pointer named, as surname; a long integer, named as ID; a pointer to a struct with the same type, named as name_next; a pointer to a struct with the same type, named as surname_next; a pointer to a struct with the same type, named as ID_next.
You should declare a student struct with the mentioned features above. You should implement a function insertNode to insert a new node to your list. You should carefully arrange the pointers to construct different orderings. You should implement a function deleteNode to delete an existing node from your list. You should carefully arrange the pointers to maintain consistent orderings. You should implement a function printList to print the content of the linked list based three different orderings. You can use the linked list examples covered in lectures to implement these functions. Firstly, you should read the names, surnames and of the students from a given input file (i.e., students.txt). The input file name is given as a first command line argument to your program. Then, you should print the content of the list to the standard output (stdout) based on three orderings. Then, print a menu to the user containing options such as; o insert a new node to the list, o delete an existing node from the list, o print the content of the list based on the three orderings to the standard output, o print the content of the list based on the three orderings to a given output file, and o exit from the program.
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