Processing a directed graph - JavaScript

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

When we do O(v+e), isn't the v double counting in a sense? In this example, there are 7 edges and then one vertex without edges, so you would have 8 total operations. But if we count all the vertices then its 5+8 = 13. So is there a way to count just the vertices without edges? Isn't that closer to the true time/space complexity?

yogeshriyat