-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: python impl for 0-1 BFS #1380
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
base: main
Are you sure you want to change the base?
Conversation
|
I think it's best to also rewrite C++ code with a newer standard to match the Python style. But could you please test both implementations on one of the example problems in the article? |
|
Updates? |
Co-authored-by: Oleksandr Kulkov <[email protected]>
Co-authored-by: Oleksandr Kulkov <[email protected]>
|
Updates looked valid. Having parallel implementations is ideal. |
|
Do we need to squash the commits into one? @adamant-pwn @mhayter |
| from heapq import heappop, heappush | ||
|
|
||
|
|
||
| d = [float("inf")] * n |
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.
Add n = len(adj) to be consistient with the C++ version.
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.
Yeah I'll look into it
|
Would be nice to add tests too |
Adding python implementation, fixing a minor grammatical error.
Recreating #1336 against the new base (
main).