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

Topological sort error? #1

Open
rockmanvnx6 opened this issue Dec 28, 2022 · 0 comments
Open

Topological sort error? #1

rockmanvnx6 opened this issue Dec 28, 2022 · 0 comments

Comments

@rockmanvnx6
Copy link

Hi @ebolat, really appreciate your blog which helps me a lot with practicing my algorithms.

Just a quick question, on https://emre.me/coding-patterns/topological-sort/. You put

in_degree[child] += 1

but this should be out_degree as there are no edges coming into the child?

Or should be in_degree[parent] += 1 but then in your hashmap needs to be graph[child].append(parent)

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

No branches or pull requests

1 participant