Skip to content

Conversation

Max-CoderBoi
Copy link

Improvements:
✅ Fixed Memory Leak: visited is now a vector, and the destructor properly deallocates adjLists. ✅ Encapsulation: visited is now local to BFS, preventing unexpected behavior. ✅ Simplified Iteration: Used range-based for loop instead of an iterator for readability. ✅ Removed Redundant Edge Addition in main().

Improvements:
✅ Fixed Memory Leak: visited is now a vector<bool>, and the destructor properly deallocates adjLists.
✅ Encapsulation: visited is now local to BFS, preventing unexpected behavior.
✅ Simplified Iteration: Used range-based for loop instead of an iterator for readability.
✅ Removed Redundant Edge Addition in main().
@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