Data Structures, Algorithms, Data Engineering, Data Science, Doubly Linked List.
class WebPage: def __init__(self, url): self.url = url self.next = None self.prev = None class BrowserHistory: def __init__(self): self.current_page = None def visit(self, url): new_page = WebPage(url) if self.current_page: self.current_page.next = new_page new_page.prev = self.current_page