You can just use LinkedList for both implementations (if you want to
avoid a commons-collections dependency).  You'd just have a "wrapper"
around it that adds to the tail and removes from either the head or
the tail depending upon the desired behavior (stack removes from the
tail while queue removes from the head).

On Sun, Feb 26, 2012 at 4:03 PM, Simone Tripodi
<simonetrip...@apache.org> wrote:
> Hola!
>
>> It's a good idea, Now we have implemented two separate methods that visit 
>> the graph for dfs and bfs. We should do a little refactoring and implement a 
>> unique method that switches between dfs and bfs simply changing the the type 
>> of visitedVertex. WDYT?
>
> it would be nice indeed, but which level of collection APIs
> abstraction you suggest to represent both a stack and a queue, to be
> passed to the visiting algorithm?
>
> If you already haas an idea, please fill an issue and work on it!
>
> best,
> -Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to