Skip to content

Earth - Olga#10

Open
OlgaSe wants to merge 1 commit intoAda-C14:masterfrom
OlgaSe:master
Open

Earth - Olga#10
OlgaSe wants to merge 1 commit intoAda-C14:masterfrom
OlgaSe:master

Conversation

@OlgaSe
Copy link

@OlgaSe OlgaSe commented Jun 13, 2021

No description provided.

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 Olga, this is a solid BFS solution, although you can write one which is O(n * E) instead.

end

while !q.empty?
current_pup, current_group = q.shift

Choose a reason for hiding this comment

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

Just a note that q.shift is an O(n) operation making this algorithm O(n^2 * E) Where n is the number of nodes and E the number of edges.

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