Current Forum: Homework 5 - Parts 1 and 2 |
Date: Thu Nov 8 2001 4:34 pm |
Author: Lee, Peter <petel@cmu.edu> |
Subject: Re: part 2, detecting visited pages efficiently... |
|
|
Since the main purpose of part 2 of this assignment is to exercise your ability to implement a breadth-first traversal, using a linear search is OK. However, as you have pointed out, this will lead to an O(n^2) algorithm. So, if you'd prefer to use a hash table (e.g., the built-in one in the JDK), that would be a very good thing to do. But not required. |
|