摘要:
C++11中一个使用for+auto时容易发生的bug 一个小坑,那就是忘记在for循环中使用auto时加引用。 例如: for(auto num : nums){ // do some thing } 可以看到,num并非nums中元素的引用,这就会导致一个问题:如果循环中有什么改变num的操作, 阅读全文
摘要:
题目 题目链接:https://leetcode-cn.com/problems/zhong-jian-er-cha-shu-lcof/ 初步题解 先放代码: /** * Definition for a binary tree node. * struct TreeNode { * int val 阅读全文