Bug Report for https://neetcode.io/problems/clone-graph
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
In the Depth First Search (typo Seacrh instead of Search) C++ solution for Clone Graph, the solution uses:
code map<Node*, Node*> oldToNew;
map has O(log V) lookup/insert operations, so the overall time complexity should be O((V + E) log V)
If the intended time complexity is O(V + E), the solution should use:
code unordered_map<Node*, Node*> oldToNew;
Bug Report for https://neetcode.io/problems/clone-graph
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
In the Depth First Search (typo Seacrh instead of Search) C++ solution for Clone Graph, the solution uses:
code map<Node*, Node*> oldToNew;map has O(log V) lookup/insert operations, so the overall time complexity should be O((V + E) log V)
If the intended time complexity is O(V + E), the solution should use:
code unordered_map<Node*, Node*> oldToNew;