Skip to content

Conversation

@Max-CoderBoi
Copy link

Key Optimizations & Fixes
✅ Fixed Incorrect adj.resize(n + 1) → adj.resize(n) ✅ Used -1 for uninitialized ancestor values
✅ Avoided unnecessary calculations in dfs()
✅ Handled single-node cases (n == 1) properly
✅ Optimized lca() to avoid redundant checks
✅ Ensured efficient input/output with ios::sync_with_stdio(false)

Key Optimizations & Fixes
✅ Fixed Incorrect adj.resize(n + 1) → adj.resize(n)
✅ Used -1 for uninitialized ancestor values
✅ Avoided unnecessary calculations in dfs()
✅ Handled single-node cases (n == 1) properly
✅ Optimized lca() to avoid redundant checks
✅ Ensured efficient input/output with ios::sync_with_stdio(false)
@Max-CoderBoi Max-CoderBoi closed this by deleting the head repository Mar 15, 2025
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.

1 participant