摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2015-10-11 21:38 dylqt 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an... 阅读全文
posted @ 2015-10-11 21:13 dylqt 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 一、动态内存与智能指针 1、new:在动态内存中为对象分配空间并返回一个指向该对象的指针;delete:接受一个动态对象的指针,销毁该对象,并释放与之关联的内存 2、两种指针:shared_ptr和unique_ptr;还有一个weak_ptr;都定义在memory中 二、shared_ptr类:智... 阅读全文
posted @ 2015-10-11 18:57 dylqt 阅读(292) 评论(0) 推荐(0) 编辑