Skip to content

Pine - Alma #26

Open
abecerrilsalas wants to merge 1 commit intoAda-C16:masterfrom
abecerrilsalas:master
Open

Pine - Alma #26
abecerrilsalas wants to merge 1 commit intoAda-C16:masterfrom
abecerrilsalas:master

Conversation

@abecerrilsalas
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, Alma. Overall it looks like a solid BFS implementation, I just left a few comments and suggestions. Let me know what questions you have.

🟢

Comment on lines +8 to +9
Time Complexity: O(V + E)
Space Complexity: O(n)

Choose a reason for hiding this comment

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

✨ Correct for a breadth first search implementation, but I would suggest you define your variables particularly because you use different variables to represent the same thing here. V and n both represent the number of vertices/nodes and E represents the number of edges.

Comment on lines +19 to +24
for i in range(len(dislikes)):
if dislikes[i]:
first_dog = i
break
if first_dog == None:
return True

Choose a reason for hiding this comment

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

Could you refactor this to avoid a break statement? Perhaps use a while loop?

Comment on lines +26 to +27
groups[first_dog] = first_group
groups[first_dog] = True

Choose a reason for hiding this comment

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

Line 27 overwrites line 26 here.

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