mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 00:16:28 +08:00
NULL to nullptr
This commit is contained in:
parent
cce8201e2b
commit
3fc3475af4
2 changed files with 4 additions and 4 deletions
|
@ -17,9 +17,9 @@ vector<int> hierOrder(TreeNode* root) {
|
|||
TreeNode* node = queue.front();
|
||||
queue.pop(); // 队列出队
|
||||
vec.push_back(node->val); // 保存结点
|
||||
if (node->left != NULL)
|
||||
if (node->left != nullptr)
|
||||
queue.push(node->left); // 左子结点入队
|
||||
if (node->right != NULL)
|
||||
if (node->right != nullptr)
|
||||
queue.push(node->right); // 右子结点入队
|
||||
}
|
||||
return vec;
|
||||
|
|
|
@ -238,9 +238,9 @@ comments: true
|
|||
TreeNode* node = queue.front();
|
||||
queue.pop(); // 队列出队
|
||||
vec.push_back(node->val); // 保存结点
|
||||
if (node->left != NULL)
|
||||
if (node->left != nullptr)
|
||||
queue.push(node->left); // 左子结点入队
|
||||
if (node->right != NULL)
|
||||
if (node->right != nullptr)
|
||||
queue.push(node->right); // 右子结点入队
|
||||
}
|
||||
return vec;
|
||||
|
|
Loading…
Reference in a new issue