A stack can therefore only deal with the topmost element in its storage. That's a severe limitation, but nevertheless, a stack is the basis for a lot of work in acomputer: the limitation makes it easy to even implement it in hardware in the very core of your computer, the CPU.
Independent of that, we can implement a stack in JAVA just using a subset of the LinkedList commands. push = addFirst, pop = getFirst, peek = get(0). Hence, theimplementation is simple. However, i do want you to implement a visualization of a stack. That means, you should visualize all elements in the stack. The underlyingdata structure should be Java.util.LinkedList. I leave the visualization to you. In addition, i want you to use the stack to see it in action: reverse a string usingthe visual stack.
So, here are your tasks:
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlinesOrder Paper Now
Program a class “VisualStack”, which visualizes all elements in your own stack. It must include the command push, pop, peek, and visualize all elements in the stack.Reverse a string by pushing all single characters onto the stack. Popping them from the stack and putting them together sequentially will end in the reversed string.Your visualization should show every single step.