Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment must use Circular Doubly-Linked List with Head Node Specifications: Develop a Circular Doubly-Linked List with head node class based on the following ADT.

image text in transcribedimage text in transcribed

This assignment must use Circular Doubly-Linked List with Head Node Specifications: Develop a Circular Doubly-Linked List with head node class based on the following ADT. Name: CDLH List Data Members Node * head node; /a pointer pointing to the first node, e.g., the head node int list size:; //The size of the list Member Functions constructor bool empty) //check whether the list is empty void insert succ(Node *new, Node sucs) //insert a new node before the successor void erase node(Node *node) //delete the node from the list int erase by data(int d) // delete all the node(s) that has the data specified, return the number of nodes that have been deleted display the size of the list access the last item from the head node void display) // display all items on the list, from the first node to the last; moreover, void reverse display0 //display all items from the last to the first, also display the size double calc mean // calculate and return the mean of all nodes' data on the list The data stored in a Node object is a score between 60 and 100, generated randomly. DO NOT use the time function, so that the random numbers generated are always follow the same sequence The driver must conduct the following tasks in the order specified below: 1. Instantiate 20 Node's objects, where the scores are generated randomly (must use a loop) 2. Instantiate a CDLH List object, named exlist. 3. Insert all 20 nodes 4. Display all nodes and the size of the list 5. Display reversely of all nodes and the size of the list 6. Calculate and display the mean. 7. Delete the first node 8. Display all nodes and the size of the list 9. Display reversely of all nodes and the size of the list 10. Calculate and display the mean. 11. Erase all the nodes that have the same value as the data specified (pick a number that exists) 12. Display the all nodes and the size of the list 13. Display reversely of all nodes and the size of the list 14. Calculate and display the mean

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago