Question: Data structure: Stacks Stack is used for browser back button. Every web browser has a Back button. As we navigate from web page to web
Data structure: Stacks
Stack is used for browser back button. Every web browser has a Back button. As we navigate from web page to web page, those pages are placed on a stack (actually it is the URLs that are going on the stack). The current page that we are viewing is on the top and the first page we looked at is at the base. If we click on the Back button, we begin to move in reverse order through the pages.
- Develop a program to implement this back button functionality. Provide a menu with the following two options:
1- Visit new website: If the user chose this option, s/he should provide the URL of the website. Then this URL should be pushed into the stack.
2- Go Back: If the user chose this option, you should pop the top website from stack and display the website that is currently at the top of the stack.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
