4 ms·
I skipped around on the video. You'd literally have 1/4 the code if you just coded a graph correctly. You also keep a "counted" and "visited" variable separate
by ggggtez 8y ago
I skipped around on the video. You'd literally have 1/4 the code if you just coded a graph correctly.
You also keep a "counted" and "visited" variable separately for no reason. There is no reason to visit a node and not count it, and you can't count a node you didn't visit. Whatever optimization you think you are getting surely isn't worth it.