leetcode|C++|2020.8笔记
104.
题解
class Solution { public: int maxDepth(TreeNode* root) { if (root == nullptr) return 0; return max(maxDepth(root->left), maxDepth(root->right)) + 1; } };
C++中NULL和nullptr的区别
空指针 -> nullptr
max(b,a)
#
104.
题解
class Solution { public: int maxDepth(TreeNode* root) { if (root == nullptr) return 0; return max(maxDepth(root->left), maxDepth(root->right)) + 1; } };
空指针 -> nullptr
#