Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shreeya13garg
Copy link
Contributor

Fixes issue:

change topological_sort.py

Changes:

Changed

Comment on lines +37 to +39
arr=val.split(" ")
edge1=int(arr[0])
edge2=int(arr[1])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()
Copy link
Member

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
Copy link
Member

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):
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants