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

Earth - Denise - Bipartition Graph #6

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

Conversation

dnsrocha
Copy link

@dnsrocha dnsrocha commented Jun 4, 2021

that was interesting.

Copy link

@CheezItMan CheezItMan 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 Denise, good BFS solution. Well done.

queue << dog

until queue.empty?
current = queue.shift #takes 1st element off the queue

Choose a reason for hiding this comment

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

Just a note that this operation on an array is O(n), making this algorithm O(N^2 + E) where N is the number of nodes and E the number of edges.

@@ -1,4 +1,37 @@


def possible_bipartition(dislikes)

Choose a reason for hiding this comment

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

👍

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