This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Begin While G has a non-visited node v do. Visited (v) =1 ; Add queue (Q,v) ; While Q do. X = remove queue (Q) ; For every adjacent node w of X do. If visited (w)=o Then visited (w)=1 ; add queue (Q,w) ; Endif End for End while End while End. Complexity: O(max(n,e))...
View Full Document
- Fall '09