Depth First Search (DFS) Algorithm Python Implementation

preview_player
Показать описание
Best Courses for Analytics:
---------------------------------------------------------------------------------------------------------

Best Courses for Programming:
---------------------------------------------------------------------------------------------------------

Best Courses for Machine Learning:
---------------------------------------------------------------------------------------------------------

Best Courses for Statistics:
---------------------------------------------------------------------------------------------------------

Best Courses for Big Data:
---------------------------------------------------------------------------------------------------------

More Courses:
---------------------------------------------------------------------------------------------------------

Full Disclosure:
Please note that I may earn a commission for purchases made at the above sites! I strongly believe in the material provided; I only recommend what I truly think is great. If you do choose to make purchases through these links; thank you for supporting the channel, it helps me make more free content like this!
Рекомендации по теме
Комментарии
Автор

I love these bite (byte hehehe) sized DSA videos! Sometimes I don't practice leetcode consistently and these videos really help as a good refresher

StLouis-bifi
Автор

remember, this is good for learn, and know more of algorithms, but in real wold applications a library always is better

lucasc
Автор

class TreeNode:
def __init__(self, value):
self.value = value
self.children = []

# Creating a tree
rootA = TreeNode("A")
nodeB = TreeNode("B")
nodeC = TreeNode("C")
nodeD = TreeNode("D")
nodeE = TreeNode("E")
nodeF = TreeNode("F")
nodeG = TreeNode("G")

root.children = [nodeB, nodeC, nodeD]
nodeB.children = [nodeE, nodeF]
nodeE.children = [nodeG]

# Calling depth-first search
print("Depth-First Search:")
depthFirstSearch(root)

bhataamirs
Автор

Shouldnt the tree parameter be called root or something? You use it like a node inside the function so i dont understamd why tree is a suitable name for it

spacey
Автор

Bro makes all kinds of videos trough Algorithm and DS to machine learning, but still has low views, I wonder why

artinzareie
Автор

So the "tree" is a node not the all f... tree

christianrazvan