Can you give proper data structure used to represent graph in your case ?
On Wed, Aug 1, 2012 at 9:42 PM, harsha harshacoo...@gmail.com wrote:
hello all,
i was recently trying to solve a BFS problem where each node is
represented by a different arrangement of elements in an array but am
the nodes in the graph are implicit. i start with a vector of integers and
depending on the conditions of the question i perform some operations on
this initial vector and these new vectors become nodes in my graph too. i
can't figure out how to mark these nodes as visited.
On Sun, Aug 5, 2012 at
hello all,
i was recently trying to solve a BFS problem where each node is represented
by a different arrangement of elements in an array but am unable to come
with a data structure to keep track of the visited nodes. generally nodes
are different strings so we can just use map and set visited
Let G = (V, E) be a **, cONNECTED undirected graph. Give an O(V + E)-time
algorithm to compute
a path in G that traverses each edge in E exactly once in each direction.
Describe how you can
find your way out of a maze if you are given a large supply of pennies.
from clrs
--
You received this
one possible solution can be that while storing the graph using adjacency
lists u can associate a color variable with each edge so that u color the
edge as u traverse it
like if u want to check wether edge (u,v) has been traversed while
traversing u's adjacecny list check wether (u,v) has been
Cud any1 tell me hw to implement BFS without a queue?!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
Cud any1 tell hw 2 implement BFS of a tree without queue?!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
BFS a binary tree but print the last row in reverse order.
a
/\
bc
/\
d f
OUTPUT-abcfd
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from