1. 7-1 Chapter 7 Stacks and Queues Data Structures and Design in Java © Rick Mercer 2. 7-2 Stacks A Stack Is a collection with one accessible element--the most recent…