Write a program in C++, and implement a link-based Stack ADT. the program needs the following:
- A Node ADT which will have two attributes – a data attribute and a pointer attribute. Remember the Node has to be an ADT, so that it can hold any kind of data.
- You can choose to use this node as both a data and a head-pointing node or as a simple data node in which case you will need a new head pointing node. For the head-pointing node, please implement both front and rear pointers, even if you may not need to use them.
- A Singly Linked List ADT which will be composed of one or more of your nodes. Implement the most common linked-list behaviors as explained in class – new list, add anywhere, delete anywhere, find anywhere, count of items in the list, empty the list, etc.
- Finally, implement a Stack ADT based on your singly linked list which will implement the most common Stack operations like push, pop, isempty etc.
- Ensure that your Node, List and Stack ADTs are mimimal and cohesive with adequate walls around them. Define interfaces as needed, so you can reuse them in all your subsequent assignments.
- Then write a main that will demonstrate the capabilities of you Stack ADT with different types of data – numbers, strings and your currency objects.