-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changed topological_sort.py #4837
base: master
Are you sure you want to change the base?
Conversation
arr=val.split(" ") | ||
edge1=int(arr[0]) | ||
edge2=int(arr[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arr=val.split(" ") | |
edge1=int(arr[0]) | |
edge2=int(arr[1]) | |
arr=val.split(" ") | |
edge1, edge2 = map(int, val.split(" ")) |
g.addEdge(edge1,edge2) | ||
|
||
print("Topological Sort of the given graph-:") | ||
g.topologicalSort() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reformat this file using black.
@@ -0,0 +1,43 @@ | |||
from collections import defaultdict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old filename was better.
self.V = vertices | ||
|
||
|
||
def addEdge(self,u,v): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename all these functions so they use underscore case.
Fixes issue:
change topological_sort.py
Changes:
Changed