Replies: 1 comment 3 replies
-
Hi,如果想要更新代码,请提交 Pull Request |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
匿名内部类创建泛型实例,显示类型参数声明来指定类型参数,且使用双括号初始化的匿名内部类可能会导致一些性能问题,最好还是分开
1、chapter_tree/binary_tree_bfs/binary_tree_bfs 类中 的
Queue queue = new LinkedList<>() {{ add(root); }};
需要改为
Queue queue = new LinkedList() {{ add(root); }};
2、 chapter_graph/graph_bfs类中的
Set visited = new HashSet<>() {{ add(startVet); }};
需要改为
Set visited = new HashSet() {{ add(startVet); }};
3、utils/TreeNode类中的
Queue queue = new LinkedList<>() {{ add(root); }};
需要改为
Queue queue = new LinkedList() {{ add(root); }};
Beta Was this translation helpful? Give feedback.
All reactions