Skip to content

cedar mac#36

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

cedar mac#36
mac-madison wants to merge 1 commit intoAda-C16:masterfrom
mac-madison:master

Conversation

@mac-madison
Copy link

No description provided.

Comment on lines +9 to +10
Time Complexity: ?
Space Complexity: ?

Choose a reason for hiding this comment

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

⏱🪐 Time and space complexity?

Comment on lines +17 to +18
group_1 = 0
group_2 = 1

Choose a reason for hiding this comment

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

Consider making all caps, as you use these as constants

Suggested change
group_1 = 0
group_2 = 1
GROUP_1 = 0
GROUP_2 = 1

groups[start_dog] = group_1
queue = deque()
queue.append(start_dog)
while queue:

Choose a reason for hiding this comment

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

🐩 Nice BFS implementation

@kyra-patton kyra-patton marked this pull request as draft July 25, 2022 00:01
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.

🐾🐶 Overall nice implementation Mac. It looks like you got your logic a bit backwards at one point, but overall it seems like you have a good understanding of BFS. I'm marking this as a yellow since the time and space complexity are missing and not all of the tests are passing. Feel free to update to receive a green score.

Let me know what questions you have.

🟡

for disliked_dog in dislikes[curr_dog]:
if groups[disliked_dog] is None:
groups[disliked_dog] = (
group_1 if groups[curr_dog] == group_1 else group_2

Choose a reason for hiding this comment

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

🤔 I think you mixed up your logic a bit here. If the current dog is in group_1 then you want the disliked dog to be in group_2.

Suggested change
group_1 if groups[curr_dog] == group_1 else group_2
group_2 if groups[curr_dog] == group_1 else group_1

@kyra-patton kyra-patton marked this pull request as ready for review July 25, 2022 05:09
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