The following is a pseudocode description of what to do:
Load the first page. Find all the links. Insert each of these links into a queue. Loop until the queue is empty{ Remove a link from the front of the queue. If this is a new link (see below) { Load that page and find the links on that page. Insert those links onto the queue. } }The problem with this is that you might end up going in circles without ever ending -- if page 1 includes a link to page 2 and page 2 links back to page 1...
The solution is to maintain a list of all the "visited" links. When a link comes off the queue, it should be processed only if it has never been visited yet.
It is up to you how you implement the "visited" links (array, list, sorted, unsorted ...) BUT, you MUST document your implementation and explain in comments how you implemented it, and why you chose that implementation
Run your program and all the tests twice: once using the queue class implemented using an array and once using a queue class implemented using nodes.