Skip to content

Commit

Permalink
fix comment for depth first search
Browse files Browse the repository at this point in the history
  • Loading branch information
shellfly committed Feb 2, 2020
1 parent 46811de commit de38800
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions algs4/depth_first_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
Run depth first search on an undirected graph.
Runs in O(E + V) time.
% python depth_first_search tinyG.txt 0
% python depth_first_search.py tinyG.txt 0
0 1 2 3 4 5 6
NOT connected
% python depth_frist_search tinyG.txt 9
% python depth_first_search.py tinyG.txt 9
9 10 11 12
NOT connected
Expand All @@ -32,6 +32,7 @@ def dfs(self, G, v):
if not self.marked[w]:
self.dfs(G, w)


if __name__ == '__main__':
import sys
f = open(sys.argv[1])
Expand Down
2 changes: 1 addition & 1 deletion algs4/red_black_bst.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,5 +361,5 @@ def balance(self, h):
for s in st.level_order():
print(s + " " + str(st.get(s)))
print()
for s in st.keys():
for s in st.Keys():
print(s + " " + str(st.get(s)))
2 changes: 1 addition & 1 deletion algs4/sequential_search_st.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ def is_empty(self):
st.put(key, i)
i += 1

for key in st.keys():
for key in st.Keys():
print(key + " " + str(st.get(key)))

0 comments on commit de38800

Please sign in to comment.