IsBalanced
来源:互联网 发布:七天网络如何注册账号 编辑:程序博客网 时间:2024/06/17 20:57
bool IsBalanced(BinaryTreeNode* pRoot, int* pDepth){ if(pRoot == NULL) { *pDepth = 0; return true; } int left, right; if(IsBalanced(pRoot->m_pLeft, &left) && IsBalanced(pRoot->m_pRight, &right)) { int diff = left - right; if(diff <= 1 && diff >= -1) { *pDepth = 1 + (left > right ? left : right); return true; } } return false;}
- IsBalanced
- Leetcode: isBalanced
- 4.1 isBalanced tree
- isBalanced平衡树
- 设置和获取cookie
- 面向对象 上
- 一致性哈希~~~~~~~~~~
- 苹果图标apple-touch-icon-precomposed和apple-touch-icon两种设置的区别探究
- 设计模式C++描述----20.迭代器(Iterator)模式
- IsBalanced
- 在linux环境下安装infobright
- 自适应网页设计
- struts part3
- Android动画 之 Tween Animation(RotateAnimation 旋转动画)
- 面向對象學習總結(中)
- ANDORID~支持的设备
- IIS重装后需重新注册
- AS3 中使用 URLRequest 和 URLLoader 与服务器交互