CLRS icon indicating copy to clipboard operation
CLRS copied to clipboard

Error in 22.1-1

Open zjplab opened this issue 7 years ago • 1 comments

check stackoverflow

zjplab avatar Feb 18 '18 11:02 zjplab

I agree with you @zjplab . My approach is adding out-degree and in-degree attributes to each vertices just like PI and D attributes and calculate the value while searching the Graphs only. So we need to initialize these attributes just like we initialize PI and D attributes value. So that's O(V). And searching part of BFS takes O(E) time. Hence total of O(V+E). Hope this helps.

mhhacker36 avatar Mar 04 '18 06:03 mhhacker36