Question
Using C++ Write a class for circular-queue. Length of circular queue will be kept in private section of class. Array for circular-queue, counter for items
Using C++ Write a class for circular-queue. Length of circular queue will be kept in private section of class. Array for circular-queue, counter for items of queue, start and end points of queue will be kept in protected section. In public section there will be three functions and a constructor. Constructor will be used to initialize all variables and also it will be possible to determine length of queue just by sending a parameter to constructor. set function will be used to send an item into queue; if all locations are occupied, function will print Queue is Full message on screen. get function will just return current item from queue; if all locations are empty, function will print Queue is Empty message on screen. Finally, showqueue function will just return length of queue.
IMPORTANT: Circular queues use FIFO or LILO principle. Stacks use LIFO or FILO principle.
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