Question: Create a new template class DoublePopStackArrFn as a child of class StackArray: what we did in class, DoublePopStackArrFn works exactly like StackArray except pop function
Create a new template class DoublePopStackArrFn as a child of class StackArray: what we did in class, DoublePopStackArrFn works exactly like StackArray except pop function removes two items from the top. If there is only one element in the stack, just pop the one element, and report that the stack is now empty. If stack is empty, it should just report that stack is empty.
II Now implement the StackArray using class StackLLFn using a LinkList. All pertaining functions for stack should be implemented in the Link List. Now add a doublePopFnfunction to the StackLLFn class which like in I pops two elements instead of one if there are more than one element. If there is only one element, then that element alone is popped.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
