(due to: wednesday, may 19th)
Define a virtual class named buffer. Then by using
this class define two more classes stack, and queue.
And then by using the queue class define a priority class pqueue.
-
All the standard basic operations (e.g. pop, push, etc. for stack) should
be defined on each of the classes in the standard way. (Refer to your
data structures textbook for the standard names and parameters of these
functions)
-
All classes should be defined using templates, so that they may
accept any type of data.
-
Do everything dynamically.
-
Write a function(s) named display, that can work on all of these
classes, and shows the data stored in a stack, queue, or a priority
queue. (This function(s) should be virtual, and friend). You can
assume that data stored will be in a displayable type (for example int,
float, char or etc.)
-
To determine the priority in pqueue you can assume that the data can be
only in a built in type (e.g. int, float, char, etc.). Arrange the priority
queue always in an ascending way.
-
Do not write any main function because main function will
be written by us.
Use and observe tin for updates, and comments.