> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0133_clone_graph/slt.md).

# 思路1 递归dfs

用一个数组visited来存放新创建的结点

这个数组同时实现了两个功能：

* 判断val对应的新的结点有没有被创建
* 通过val值get新建的结点
