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

Update BuildingTeams PySol content/3_Silver/Graph_Traversal.mdx #4917

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

CryoJS
Copy link
Contributor

@CryoJS CryoJS commented Nov 10, 2024

Description

Adds new Python Solutions to https://cses.fi/problemset/task/1668/ for content/3_Silver/Graph_Traversal.mdx.
Relates to #3444

Runtimes

DFS (missing Python): https://cses.fi/problemset/result/11118878/ (0.74s)
Previous BFS Sol: https://cses.fi/problemset/result/11118911/ (0.90s)
New BFS Sol: https://cses.fi/problemset/result/11118910/ (0.69s)

Note: Updated/changed the pre-existing Python BFS solution as I had a simpler, faster solution.


Place an "x" in the corresponding checkbox if it is done or does not apply to this pull request.

  • I have tested my code.
  • I have added my solution according to the steps here.
  • I have followed the code conventions mentioned here.
    • I understand that if it is clear that I have not attempted to follow these conventions, my PR will be closed.
    • If changes are requested, I will re-request a review after addressing them.
  • I have linked this PR to any issues that it closes.

content/3_Silver/Graph_Traversal.mdx Outdated Show resolved Hide resolved
content/3_Silver/Graph_Traversal.mdx Outdated Show resolved Hide resolved
content/3_Silver/Graph_Traversal.mdx Outdated Show resolved Hide resolved
content/3_Silver/Graph_Traversal.mdx Show resolved Hide resolved
Comment on lines -1223 to -1224
assigned = [0 for _ in range(n)]
valid = True
Copy link
Contributor

Choose a reason for hiding this comment

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

just now realizing that this is replacing an old sol
uneasy about this bc the old one was consistent w/ java and c++, while this one isn't

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: Updated/changed the pre-existing Python BFS solution as I had a simpler, faster solution.

Yeah, I mentioned it in the description. If that's a concern, we just just use the old one. If so, I can try to see if there are any optimizations that can be made while still keeping it consistent with the other language's solutions (unless it's exactly the same).

Copy link
Contributor

Choose a reason for hiding this comment

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

I can try to see if there are any optimizations that can be made while still keeping it consistent

i'd love this

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.

4 participants