Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update graph.md - use popleft() instead of pop() in the queue - Topological sort #685

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

Open
SniperBuddy101 wants to merge 1 commit into yangshun:main
base: main
Choose a base branch
Loading
from SniperBuddy101:main

Conversation

Copy link

@SniperBuddy101 SniperBuddy101 commented Jan 30, 2025

No description provided.

Copy link

@shardul-shah shardul-shah left a comment

Choose a reason for hiding this comment

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

@yangshun +1 on this PR. This is the mistake I also noticed, which we discussed earlier today, and which you agreed was a mistake.

Reasoning: Topological sort uses BFS and a queue. If we append to the back (index -1) of the queue, we should pop from the front of the queue - index 0, that is. queue.popleft() (since we use deque).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@shardul-shah shardul-shah shardul-shah approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /