Skip to content

Conversation

@Max-CoderBoi
Copy link

Key Optimizations:
Replaced list* adjLists with vector<vector> adjLists: More modern and avoids manual memory management. Replaced bool* visited with vector: Automatically manages memory and is safer. Used queue instead of list: More intuitive for BFS. Used range-based loops (for (int adjVertex : adjLists[currVertex])): More readable.

Key Optimizations:
Replaced list<int>* adjLists with vector<vector<int>> adjLists: More modern and avoids manual memory management.
Replaced bool* visited with vector<bool>: Automatically manages memory and is safer.
Used queue<int> instead of list<int>: More intuitive for BFS.
Used range-based loops (for (int adjVertex : adjLists[currVertex])): More readable.
@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