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 c++ function to create a dynamic sorted (in ascending order according to the age)doubly 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. 7. Write a function to print the linked list (from tail node) on the console. Implement the above functions as follows. Initially, the list must have five nodes that are the instances of the struct whose member variable age are: 18, 21, 25, 27 and 33. Insert three nodes that are instances of the struct with age variable: (i) 17, (ii) 23 and (iii) 34. Print the list from head node (in ascending order). Remove three nodes that are instances of the struct with age variable 17, 25, and 34. Print the list from tail node (in descending order). Search the list to find whether an element that corresponds to the student with age 23. Insert a node that is an instance of struct with age variable 29. Print the number of elements in the list. Print the list from head (in ascending order) on the console

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

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 c++ function to create a dynamic sorted (in ascending order according to the age)doubly 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.
7. Write a function to print the linked list (from tail node) on the console.


Implement the above functions as follows.
Initially, the list must have five nodes that are the instances of the struct whose member variable age are: 18, 21, 25, 27 and 33. Insert three nodes that are instances of the struct with age variable: (i) 17, (ii) 23 and (iii) 34. Print the list from head node (in ascending order). Remove three nodes
that are instances of the struct with age variable 17, 25, and 34. Print the list from tail node (in descending order). Search the list to find whether an element that corresponds to the student with age 23. Insert a node that is an instance of struct with age variable 29. Print the number of elements
in the list. Print the list from head (in ascending order) on the console

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Types of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education