Avoid mutable default arguments by cclauss · Pull Request #4691 · TheAlgorithms/Python · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions graphs/eulerian_path_and_circuit_for_undirected_graph.py
4 changes: 2 additions & 2 deletions graphs/frequent_pattern_graph_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ def construct_graph(cluster, nodes):
return graph


def myDFS(graph, start, end, path=[]):
def myDFS(graph, start, end, path=None):
"""
find different DFS walk from given node to Header node
"""
path = path + [start]
path = (path or []) + [start]
if start == end:
paths.append(path)
for node in graph[start]:
Expand Down
6 changes: 3 additions & 3 deletions maths/radix2_fft.py