Time Complexity of Depth First Search (DFS) Algorithm

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

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

Amazing explanation. Step by step and indepth. Wonderful!

jaskaransingh
Автор

very clear explanation. I wish you talked also about the time complexity of DFS when using the adjacency matrix, which should be O(n^2)

guglielmolamastra
Автор

very clear explanation. thanks a lot sir. Please make videos of other topics also

anonymousgirl
Автор

Very nice explanation. It is useful for GATE CS. Thanks a lot.

AdeshPaul
Автор

FYI DFS cannot be used to find shortest path.
But the video was very well structured and informative. Thanks

deva
Автор

The O(V) ideally comes from visited[V]=true. We can do away with the initialization by having a visited set instead of an array.

arshad
Автор

omg NCSU! I’m fellow NCSU student who’s studying for leetcode !

iChanda
Автор

love your handwriting on that whiteboard man.
a quick question,
O(V) comes from initialization(just once at the beginning),
but, doesn't 'visited[v]=true' also make O(V)?
cuz DFS function gets called V times in total.
thanks for great lectures ;)

starriet