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

Arcila Maple C16 #42

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

Arcila Maple C16 #42

wants to merge 2 commits into from

Conversation

arcila13
Copy link

No description provided.

Copy link

@kyra-patton kyra-patton left a comment

Choose a reason for hiding this comment

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

🐾🐶 Nice work! I left a comment on your space complexity, but overall it looks like you have a good understanding of BFS. Let me know what questions you have.

🟢

Time Complexity: ?
Space Complexity: ?
Time Complexity: O(N+E)
Space Complexity: O(N+E)

Choose a reason for hiding this comment

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

🪐 Space complexity would actually be O(N) here since the two data structures you are creating are a graph that will hold an integer value for each of N nodes in dislikes and the queue will similarly hold at most N nodes.

group = {}
dog_que = deque()

for dog in range(len(dislikes)):

Choose a reason for hiding this comment

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

🐩 Very nice BFS solution!

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.

2 participants