Dual Stack and DLL ||  Easy With Comment  || Java
\n//APPROACH 1\n\nclass BrowserHistory \n{\n    Stack<String> Hist_B;//backward history of web pages\n    Stack<String> Hist_F;//forward history of web pages\n 
```\n//APPROACH 1\n\nclass BrowserHistory \n{\n    Stack<String> Hist_B;//backward history of web pages\n    Stack<String> Hist_F;//forward history of web pages\n    \n    public BrowserHistory(String homepage)\n    {\n        Hist_B=new Stack<String>();\n        Hist_F=new Stack<String>();\n        \n        Hist_B.push(homepage);//homepage is pushed, it has no forward history \n    }\n    \n    public void visit(String url) \n    {\n        Hist_F.clear();//forward histrory of the previous web page is cleared \n        Hist_B.push(url);//forward history will be based on this current web page \n    }\n    \n    public String back(int steps) \n    {\n        while(steps-->0 && Hist_B.size()>1)//at least 1 web page mus be present for whomem we are finding the forward history \n        {\n             Hist_F.push(Hist_B.pop());//storing the history for forward operation after\n        }\n        return Hist_B.peek();//this web page forward history is made \n    }\n    \n    public String forward(int steps) \n    {\n        while(steps-->0 && !Hist_F.isEmpty())\n        {\n             Hist_B.push(Hist_F.pop());//popping from history till a particular limit \n        }\n        return Hist_B.peek();//and the new current web page \n    }\n}//Please do vote me, It helps a lot\n```\n```\n//APPROACH 2\n\nclass Node//for the node in the DoublyLinkedList\n{\n    String url;\n    Node prev,next;\n    Node(String url)\n    {//iinitializing the data  member \n        prev=null;\n        next=null;\n        this.url=url;\n    }\n }\nclass BrowserHistory \n{\n    Node curr;//pointer to the current node \n    public BrowserHistory(String homepage)\n    {\n        Node head=new Node(homepage);//innsertion of the homepage in the DLL \n        curr=head;\n    }\n    \n    public void visit(String url) \n    {\n         Node temp=new Node(url);//creation of node \n         temp.prev=curr;//current node previous pointing to the previous node \n         curr.next=temp;//pevious node pointing to the current  node \n         curr=curr.next;//current poining\n    }\n    \n    public String back(int steps) \n    {\n        while(curr.prev != null & steps-->0)\n        {\n            curr=curr.prev;//moving the current pointer in the reverse direction till the limit step \n        }\n        return curr.url;//returning the url of the current desired page \n    }\n    \n    public String forward(int steps) \n    {\n       while(curr.next !=null && steps-->0)\n       {\n           curr=curr.next;//moving the current pointer in the forward direction till the limit step \n       }\n        return curr.url;//returning the url of the current desired page\n    }\n}//Please do vote me, It helps a lot\n```
['Linked List', 'Stack', 'Java']