原文链接:http://91daixie.com/cases/6/22/CS1020Take-HomeLab03.html
程序背景是一个老师,在玩他自己的浏览器的时候,发现了浏览器的标签页和链表的关系,所以出了这道题目。
ugene is a university lecturer who is teaching a basic data structures and algorithms course. At the moment, Eugene is bored. Since he has nothing better to do now, he starts playing around with his internet browser. His browser, along with most browsers available today, has a support for multiple tabs. This means that we can open multiple websites in one single window, in a mini-window that we call ‘tabs’. At any given time, there is at least one tab open. The tabs are arranged in a list. One of them is a ‘current tab’ that the user is currently viewing. Here is an example of tabs:
1.When a user opens the browser, the page “http://www.comp.nus.edu.sg” is opened by default.
当用户打开浏览器,那么就会打开默认首页。
2.There are multiple operations that users can do in the browser:
— 用户在浏览器中可以进行多种操作。
可以打开新标签页。
可以关闭当前页面。
切换到下一个页面
切换到前一个页面。
打开一个特定的页面。
打开一个含有特定界面的新标签页。
2.You are free to define your own linked list class (encouraged for practice and skeleton file given), but you are allowed to use Java’s built-in linked list implementation if it is suitable for this problem.
事实上,用一个可以自由删除添加访问元素的链表可以对此问题进行建模,从而解决问题。