- 博客(2)
- 收藏
- 关注
原创 list.remove报错原因
for(Message message:received){ if(a.add(message.sequence)){ received.remove(message);// 这里报错 } }上述代码报错的原因是在foreach中调用了remove,因为foreach相当于调用了iterator,...
2020-04-25 11:35:01 561
原创 LeetCode1 - 回溯算法
参考链接:https://leetcode-cn.com/problems/permutations/solution/hui-su-suan-fa-python-dai-ma-java-dai-ma-by-liweiw/在刷LeetCode的时候刷到全排列的问题,从而看了回溯算法,回溯算法是“深度优先搜索”时使用的方法,因为在深度优先搜索时,当我们沿一条路径走到头之后,我们需要返回之前的某一...
2020-04-21 21:14:53 115
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人