Question: Problem 1: Create a deck of 52 cards without repetition and insert in a template Stack Array. Write a virtual base class having two derived
Problem 1: Create a deck of 52 cards without repetition and insert in a template Stack Array.
Write a virtual base class having two derived class one for StackFullException and other for
StackEmptyException. Catch the errors when the array is empty or out of bound.
Problem 2: Create a template Stack Array of unlimited size based on tight strategy and another
based on growth strategy. Show in the tight strategy total cost is O(n
2
/c) where c is the size of
expanded array when full, and the total cost in growth strategy is
(4n-1).
Problem 3. Convert the following infix expression to a prefix expression by Stack operation.
A + B* C + (D^E) * F/G/H + I
Evaluate the value of prefix expression when A=5, B=10, C=3, D=12, E=3, F=5, G=8, H=4,
I=100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
