-
Notifications
You must be signed in to change notification settings - Fork 65
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
cedar mac #36
base: master
Are you sure you want to change the base?
cedar mac #36
Conversation
Time Complexity: ? | ||
Space Complexity: ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏱🪐 Time and space complexity?
group_1 = 0 | ||
group_2 = 1 |
There was a problem hiding this comment.
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
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐩 Nice BFS implementation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
.
group_1 if groups[curr_dog] == group_1 else group_2 | |
group_2 if groups[curr_dog] == group_1 else group_1 |
No description provided.