NULL to nullptr
This commit is contained in:
parent
cce8201e2b
commit
3fc3475af4
@ -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 New Issue
Block a user