Object-Oriented Programming · C3.ai · Medium
Build a class that tracks the navigation history of a browser with just one tab. When the object is created, the tab is showing a homepage. The class must support three operations: visiting a new URL, moving back a given number of steps, and moving forward a given number of steps. Whenever a new URL is visited, any pages that could previously have been reached by going forward are discarded. A back or forward request that asks for more steps than the history allows simply…