commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <ja...@carmanconsulting.com>
Subject Re: [graph] Doubts on DFS algorithm implementation
Date Sun, 26 Feb 2012 21:11:36 GMT
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
<simonetripodi@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-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

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


Mime
View raw message