LINKELIST JAVA APPROACH JAVA
\nclass BrowserHistory {\n\n  LinkedList<String> list = new LinkedList<>();\n    int index = 0;\n    public BrowserHistory(String homepage) {\n        list.add(
```\nclass BrowserHistory {\n\n  LinkedList<String> list = new LinkedList<>();\n    int index = 0;\n    public BrowserHistory(String homepage) {\n        list.add(homepage);\n    }\n    \n    public void visit(String url) {\n        index++;\n        list.add(index, url);\n        while(index < list.size()-1){\n            list.removeLast();\n        }\n        return;\n    }\n    \n    public String back(int steps) {\n        if(index-steps < 0){\n            index = 0;\n            return list.getFirst();\n        } \n        index -=steps;\n        return list.get(index);\n    }\n    \n    public String forward(int steps) {\n        if(index+steps >= list.size()){\n            index = list.size()-1;\n            \n            return list.getLast();\n        } \n        index+= steps;\n        return list.get(index);\n}\n}\n```
['C', 'Java']