PRASHNIKAप्रश्निका
‹ Back to the paper

Write the program described below.

Name the entity described above and state its principle.

Computer Science20261 markShort answer
Show the case
In any internet browser, a user can visit new webpages and go back to previously visited webpages. Each new webpage URL is stored in browser's memory such that when the user clicks 'Back' button, the previous webpage gets displayed. The details of the members of the class are given below: Class name : Browser Data members/instance variables: pages[ ] : an array to hold the URLs of visited webpages max : to store the maximum capacity of the array top : to point to the index of the last visited webpages Methods/Member functions: Browser(int cap) : constructor to assign max = cap and top = -1 void visit(String url) : to add URL of a new webpage if possible, else display the message "Browser history full" String back( ) : to remove and return the last visited webpage URL, if present, else to return the message "No previous browser history"

Answer

Answer

AI
Entity name: Stack Principle: LIFO (Last In, First Out). The most recently visited URL added to the stack is the first one retrieved when navigating back.
Data structures

From ISC 2026 Computer Science Paper 1, question 9(ii).