GeeksforGeeks » Miscellaneous
Why 3 colors in BFS algo given in cormen book?
(1 post)-
Why does the following link use 3 colors for BFS of graph. Same algo is given in Cormen book also.
http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/breadthSearch.htmThe program could be implemented only with 2 (marked or not). In fact the algo given on Wiki page (http://en.wikipedia.org/wiki/Breadth-first_search#Pseudocode) uses only on 1 bit.
Reply
You must log in to post.