Please I need help with this in C Q1 What is an ADT Stack

Please.... I need help with this... in C++

***************************************************************************

Q1.

What is an ADT Stack ?

Give an real world example...

What do you think would be the best way to implement it ?

Q2.

Test it by creating a DRIVER/Test file with int main, and
Test the stack class and its basic functionality.

Program 1 - STL STACK

Create a LIST of 10 words. Use the STL class <stack>.  

This means you are NOT writing the class, it has already been written for you.

Use #include <stack> at the top of the program.

Input the list from cin input.

Use the stack to reverse the list.

Print out reversed list

Test with 10 words... able, bread, corn, dog, elephant, frog, ground, House, Italy, Jam

Solution

Question:1

ADT Stack: Its basically a abstract data type having the linear sequence of various arbitary numbers. The various features of it are given below:

i) Its having list structure and of type LIFO (last in first out).
ii) In this type of data type insertion as well as deletion is done on one end that is called \"top\".
iii) ADT stacks are used as container.

Implementation of ADT Stack: There are the following two ways of ADT stack implementations:

i) Array based implementation: This is basically a static implementation. Less flexible with low overhead.
ii) Dynamic implementation: Its basically a dynamic implementation done using the pointers. More flexible with high level of overhead.

In above two implementation, the best possible way of implementation is dynamic implementation.

Real world Example: The real world example are as follows:

i) Recursion is being done using the ADT stacks.
ii) ADT stacks are used for implementing stack frames for managing various function calls

Please.... I need help with this... in C++ *************************************************************************** Q1. What is an ADT Stack ? Give an real w

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site