What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-11-09 00:08:08
Dfs program in c++
############### #The Algorithm (In English): # 1) Pick any node. # 2) If it is unvisited, mark it as visited and recur on all its # adjacent nodes. # 3) Repeat until all the nodes are visited, or the node to be # searched is found. # The grap... Add solution -
C++ 2021-10-20 03:25:06
depth first search graph
############### #The Algorithm (In English): # 1) Pick any node. # 2) If it is unvisited, mark it as visited and recur on all its # adjacent nodes. # 3) Repeat until all the nodes are visited, or the node to be # searched is found. # The grap... Add solution -
Python 2021-10-19 10:17:11
dictionary functions in python
# PYTHON DICTIONARY METHODS METHOD DESCRIPTION clear() Removes all the elements from the dictionary copy() Returns a copy of the dictionary fromkeys() Returns a dictionary with the specified keys and value get() Returns the value... Add solution -
Other 2021-10-11 15:10:12
python simple depth first search
# Using a Python dictionary to act as an adjacency list graph = { '5' : ['3','7'], '3' : ['2', '4'], '7' : ['8'], '2' : [], '4' : ['8'], '8' : [] } visited = set() # Set to keep track of visited nodes of graph. def dfs(visited, graph, node):... Add solution -
Java 2021-09-22 08:16:07
depth first traversal graph java
############### #The Algorithm (In English): # 1) Pick any node. # 2) If it is unvisited, mark it as visited and recur on all its # adjacent nodes. # 3) Repeat until all the nodes are visited, or the node to be # searched is found. # The grap... Add solution -
C++ 2021-09-17 01:21:01
create a dictionary cpp
// The equivalent to python dictionaries are maps in c++ map<int, char> mymap; // Enter required types and name mymap[1] = 'a'; mymap[4] = 'b'; cout << "my map is -" << mymap[1] << " " < <mymap[4... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5