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

The DFS method is incorrect. #1

Open
AlifBrahim opened this issue Jan 15, 2023 · 0 comments
Open

The DFS method is incorrect. #1

AlifBrahim opened this issue Jan 15, 2023 · 0 comments

Comments

@AlifBrahim
Copy link

The original output for the DFS if the node starts at 2 is as follows,
Depth-first search visitation order
[2, 5, 6, 4, 3, 8, 7, 1]

It should be,
[2, 1, 3, 5, 4, 6, 7, 8]

I've created a pull request for the correct method.

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