Skip to content

Bug Report for clone-graph #5958

Description

@KartikGS

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions