Demo entry 6349599

dfs

   

Submitted by anonymous on Feb 23, 2017 at 08:28
Language: Python 3. Code size: 248 Bytes.

def dfs(currNode):
    if currNode.isEndOfSearch():
        return
    # do something with currNode
    currNode.setVisited(true)
    for node in currNode.getAdjacentNodes():
        if not node.isVisited():
            dfs(node)
        

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).