C++ Please!
The ADT stack lets you peek at its top entry without removingit. For some applications of a stack, you need toalso peek at the entry beneath the top entry without removing it.Let’s name such an operation peek2 . If peek2fails because the stack contains fewer than two entries, it shouldthrow an exception.
Write a link-based implementation of the ADT stack thatincludes both peek and peek2 .
C++ Please! The ADT stack lets you peek at its top entry without removing it. For some applications of a stack, you need
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am