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
Pseudo code for topological sort #77
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines. |
Although the pseudocode is correct, it does not go into the details of how to implement the above algorithm efficiently. (For example, it talks about deleting an edge which takes linear time, and hence the overall algorithm can jump upto O(n^2).) However, in Kahn's Topological Sort, we don't need to delete the edge each time. The workaround for this is to delete a vertex virtually (effectively reducing the indegree). See this implementation for more details. (Line Number 67-99) Please make the required changes to the pseudocode. Also, do not place it inside the Sorting folder. Place it inside Please do not include binary files (such as images) in your initial pull request. This is because they remain in the history even when you delete it (say, after the code review). This takes up the Repo space. If you want to attach binary files, include them only after the review is over. Let me know if you need any more clarifications |
Alright, no problems thank you for the feed back, i'm correctiong it right now ! |
Also, there's a typo in the name of the image. It's |
So i moved the code in the right repositories, i deleted the images in the folder and i modified the pseudo code to match the edge handling in the code you gave me and i also clarified how to initialise the S set with inDegree |
Here are a couple of suggestions to get you acquainted with our coding style
|
|
I did the modifications and i added the pdf , tell me when i can push the pictures for the example ! |
There are a lot of small details still missing (like Insertion in queue using Since I've already dragged this too much, I'd request you to overwrite your TEX file with my version. You can find it here. And by overwriting, I don't mean Modify your code, just copy paste my code and replace it. I think there was a confusion last time. (I usually provide the full review in the code itself, but since I'm a bit occupied, I decided to create a new version so that you can see the differences yourself) When you are done, let me know so that I can allow you to upload the final pdf and images. |
Changes done |
Looks good. You can upload the images now. (Create another folder |
Done |
Great! Thank you for your contribution to this repository. I hope you got to learn something new from this experience. |
Congrats on merging your first pull request! We here at behaviorbot are proud of you! |
i used the pseudo code of the khan's algorithm found on wikipedia and i added below the pseudo code a detailled example on how it works.
(https://en.wikipedia.org/wiki/Topological_sorting)
This PR concerns the issue #18