2018年3月14日
摘要: 先看上面一段简单代码,写的很简单的浅拷贝,之前对于复制构造函数存在相当多的不理解。 (1)不理解为什么参数要写成引用,后来看了剑指offer后,上面说如果不写成引用,调用A的复制构造函数时参数会copy,此时会调用自己本身的复制构造函数,所以一层层的调用,直到栈溢出。 (2)赋值运算符函数为什么要返 阅读全文
posted @ 2018-03-14 23:25 gtxvs 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2018-03-14 22:29 gtxvs 阅读(110) 评论(0) 推荐(0) 编辑