29 May
2014
29 May
'14
6:53 p.m.
Sensei, I think a simple solution is to use a counter. int Count = 0; for(std::size_t v = source_node; ; v = p[v]) { Count++; if (Count > Distance) { break; } }