Have a Question ?

Home / Answered Questions / Other / 2-design-and-implement-a-method-for-the-stack-class-discussed-in-class-that-outputs-prints-the-items-aw435

(Solved): 2) Design And Implement A Method For The Stack Class -discussed In Class- That Outputs -prints- The ...


USING RECURSION!!

2) Design and implement a method for the stack class -discussed in class- that outputs -prints- the items in the stack from b

2) Design and implement a method for the stack class -discussed in class- that outputs -prints- the items in the stack from bottom to top with the condition that after the execution of this method the content of the stack is equal to the content of the stack before the method was called. You may assume that the items in the stack are printable. You cannot use any variables of any aggregate data types such as lists or sets or dictionaries etc.


We have an Answer from Expert View Expert Answer

Expert Answer


solution: I have written the program to print the elements of stack from bottom to top and elements still remain in stack. We can do this by two ways one is recursively, by poping elements from top an
We have an Answer from Expert
Buy This Answer $5

-- OR --

Subscribe To View Unlimited Answers
Subscribe $12 / Month