From 6fdcc59aec48b8c3bb02dcc90b6709fd2ae566d2 Mon Sep 17 00:00:00 2001 From: sss1h <49825610+sss1h@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:26:57 +0800 Subject: [PATCH] =?UTF-8?q?Update=200701.=E4=BA=8C=E5=8F=89=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A0=91=E4=B8=AD=E7=9A=84=E6=8F=92=E5=85=A5=E6=93=8D?= =?UTF-8?q?=E4=BD=9C.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加代码高亮 --- problems/0701.二叉搜索树中的插入操作.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/problems/0701.二叉搜索树中的插入操作.md b/problems/0701.二叉搜索树中的插入操作.md index 98e60d5f..5cb0de99 100644 --- a/problems/0701.二叉搜索树中的插入操作.md +++ b/problems/0701.二叉搜索树中的插入操作.md @@ -59,7 +59,7 @@ 代码如下: -``` +```cpp TreeNode* insertIntoBST(TreeNode* root, int val) ``` @@ -69,7 +69,7 @@ TreeNode* insertIntoBST(TreeNode* root, int val) 代码如下: -``` +```cpp if (root == NULL) { TreeNode* node = new TreeNode(val); return node; @@ -88,7 +88,7 @@ if (root == NULL) { 代码如下: -``` +```cpp if (root->val > val) root->left = insertIntoBST(root->left, val); if (root->val < val) root->right = insertIntoBST(root->right, val); return root; @@ -120,7 +120,7 @@ public: 那么递归函数定义如下: -``` +```cpp TreeNode* parent; // 记录遍历节点的父节点 void traversal(TreeNode* cur, int val) ```