更新代码块

This commit is contained in:
youngyangyang04
2021-08-10 22:20:48 +08:00
parent c7c34dd824
commit 8a2d42013c
192 changed files with 552 additions and 552 deletions

View File

@@ -93,7 +93,7 @@ if (cur == NULL) return cur;
代码如下:
```C++
```CPP
if (cur->val > p->val && cur->val > q->val) {
TreeNode* left = traversal(cur->left, p, q);
if (left != NULL) {
@@ -147,7 +147,7 @@ return cur;
那么整体递归代码如下:
```C++
```CPP
class Solution {
private:
TreeNode* traversal(TreeNode* cur, TreeNode* p, TreeNode* q) {
@@ -177,7 +177,7 @@ public:
精简后代码如下:
```C++
```CPP
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
@@ -198,7 +198,7 @@ public:
迭代代码如下:
```C++
```CPP
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {