Skip to content

Conversation

@RomanGirin
Copy link
Contributor

I'd propose to include DSU-based solution to this problem as it more efficient. If I'm not mistaken O(ElogV) would be time complexity and the approach saves some space as we don't recreate graph\tree into adjacency list prior dfs and loop over the edge list directly

Important

Please make sure the file name is lowercase and a duplicate file does not already exist before merging.

I'd propose to include DSU-based solution to this problem as it more efficient. If I'm not mistaken O(ElogV) would be time complexity and the approach saves some space as we don't recreate graph\tree into adjacency list prior dfs and loop over the edge list directly
@tahsintunan tahsintunan merged commit b78d9a8 into neetcode-gh:main Jan 18, 2023
@RomanGirin RomanGirin deleted the patch-1 branch January 18, 2023 19:15
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