Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please include a class diagram and change the linked list implementation of class List2 in the following way: Convert it to a circular list. The
Please include a class diagram and
change the linked list implementation of class List2 in the following way:
Convert it to a circular list. The node after the last node should be the first node. The node before the first node should be the last node. Do not change the implementation of class Node.
Implement all operations currently available in the class List. Do not change file list2.h.
Add a method empty(), which should return true if the circular list is empty and false otherwise.
Add a method print() to print the values in the nodes of the circular list, from the first to the last node.
Then:
Use your circular list implementation to implement a circular queue in the following three ways:
Using composition
Overriding selected public methods with private methods
Using private inheritance.
The circular queue should expose only the following methods in picture:
List2.cpp--------------------------
List2.h------------------
List2_main.cpp------------------
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