Slide 1Stacks Based on Koffmann and Wolfgang Chapter 5 Slide 2 Chapter 5: Stacks2 Chapter Outline The Stack data type and its four methods: push(E), pop(), peek(), and empty()…