From 3fc3475af4878edb7e7feae7d11b63756f057930 Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Tue, 29 Nov 2022 03:21:02 +0800 Subject: [PATCH] NULL to nullptr --- codes/cpp/chapter_tree/binary_tree_bfs.cpp | 4 ++-- docs/chapter_tree/binary_tree.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codes/cpp/chapter_tree/binary_tree_bfs.cpp b/codes/cpp/chapter_tree/binary_tree_bfs.cpp index ce0072b37..eeec2a18e 100644 --- a/codes/cpp/chapter_tree/binary_tree_bfs.cpp +++ b/codes/cpp/chapter_tree/binary_tree_bfs.cpp @@ -17,9 +17,9 @@ vector 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; diff --git a/docs/chapter_tree/binary_tree.md b/docs/chapter_tree/binary_tree.md index 422b259e5..58034b18e 100644 --- a/docs/chapter_tree/binary_tree.md +++ b/docs/chapter_tree/binary_tree.md @@ -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;