3. DFS: Depth First Search Implementation in Python | Graph Data Structure

preview_player
Показать описание
Depth First Search Implementation (DFS) in Python,
The time complexity for DFS if O(|V| + |E|), where |V|, |E| are the no of vertices and Edges in the graph respectively.
Explore a graph using DFS traversal,
Complete Algorithm of DFS including visiting and finished time tracking of vertices during DFS.

Author: Shahrukh Khan
Links

#datastructures
#Graph Traversal
#DFS
Рекомендации по теме
Комментарии
Автор

This guy deserves more subs and likes.Perfect explanation ever

titusyesurajj
Автор

Excellent Explanation... You will live on in this video forever.... 👏

annepuvijay
Автор

dude your voice is asmr ! calmness is much needed while coding.

bouncingquarks
Автор

Cool video! Keep Up the good work!! Its odd that only Indian viewers are only watching/commenting.

ayushganvir
Автор

From movie star to youtube code tutorials. Didn't know Shahrukh Khan was so diverse

jtommyboi
Автор

Sir pls post video on topological sort .... U have explained this in a best way !💕

shashankseethu
Автор

brother I wished you have explained MinMax Algo, A*, Alpha-Beta and Bayseain because your explanation are the best.

hamzahamr
Автор

Really good explanation brother.
Thanks for the video.

ghanalkaushik
Автор

no one can explain this topic better than u

BalaguruS-zpqf
Автор

in the case of undirected graph, when u add code to traverse each node that is not visited then why the node 'C' was traversed first (start time of c node is 0). Node 'A' should be traversed first or else i am missing something. The output should be [A, B, D E, C, F]

powersparkmotivation
Автор

Using bfs, can I print all *possible* paths to undirected graph node from start to end?

vijaybabaria
Автор

dfs_util("A")
print(dfs_traversal_output)
are giving me a type error 'dict is not callable'

patriciaasiimire
Автор

Sir can i insert the end target node? So we can traverse just to the target? The problem is in recursion whenever i try to stop at the target node, the other node also appended to the dfsoutput can u explain plz?

zefanyasoplantila
Автор

Super explanation. Can i get to know the time & space complexity of this algorithm?

ashwinib.bharmnaikar
Автор

For stack, does it have to be directed graph example only?

kanchidoshi
Автор

does this work if you start from any node? (i.e. what if there is no root or its not obvious what the root is - can you just pick a node at random to start?)

A
Автор

Bro nice work, why don't you upload more videos??

emeemmanuel
Автор

For the function dfs_util what is the need for writing time+=1 why do we increment after completion of the function? It is unnecessary i think sir can u explain plz!!?

AISHAIKSAMEERUDDIN
Автор

hlo sharukh sir, i try to write some code for dfs only ; is it also giving write output ; but still dont know if it pass all cases or not ; can you please check ?

sachinchandela
Автор

what does ".append" work?? For what ".append" is used??

befake