(Solved):Write a program that uses a stack to reverse its inputs. Your stack must be generic and you must demonstrate that it accepts both String and Integer types. Your stack must implement the following… View Answer…

 

Question

Write a program that uses a stack to reverse its inputs.

Your stack must be generic and you must demonstrate that it accepts both String and Integer types.

Your stack must implement the following methods:

a. push,

b. pop,

c. isEmpty (returns true if the stack is empty and false otherwise), and

d. size (returns an integer value for the number of items in the stack).

You may use either an ArrayList or a LinkedList to implement

Scroll to top