Question: Question 1 [10]. Write a struct Student that has member variables: (string) first name, (int) age and (double) fee. Write the functions as described in
Question 1 [10]. Write a struct Student that has member variables: (string) first name, (int) age and (double) fee. Write the functions as described in the class for the following purposes. 1. Write a function to create a dynamic sorted (in ascending order according to the age) circular linked list, where the data component of each node is an instance of the struct Student 2. Write a function to insert the instances in the linked list. You also need to write a function to find the spot for insertion of the nodes. 3. Write a function to remove the node from the linked list. 4. Write a function to count the elements of the linked list. 5. Write a function to determine check whether an element belongs to the linked list. 6. Write a function to print the linked list (from head node) on the console. Implement the above functions as follows. Initially, the list must have two nodes that are the instances of the struct: (studenti, 20. 20.75) and (student2, 25, 85.55) (get these values from the user). Insert two nodes that are instances of the struct: (student3, 23, 73.53) and (student4, 19, 45 37) (hardcode these values). Print the list (in ascending order). Remove one node (studenti, 20. 20.75) (hardcode: hardcode this node for removal only, not for inserting). Print the list again. Search the list to find whether the list has an element (student2, 25,85.55). Print the number of elements in the list. Question 2 [10]. Do the Question 1 above with following changes. In this question list must be in ascending order with respect to name. Also, replace the name of the students studenti, student2, student3 and student4 with Paul, John, Patel and Kaur, respectively. Question 3 [10]. Consider the Student struct as defined in Question 1 above. Implement the queue with doubly linked list whose each node has data component an instance of the struct Student. Implement the following: 1 enqueue three elements to the queue: (s1,25,20.25), (s2, 19.25.17) and (93.23, 15.72) (get from user): print the queue (11) dequeue first element from the queue (iv) get the size of the queue; check whether the queue is empty or not, (vi) print the queue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
