first commit

This commit is contained in:
suichenglixin
2021-05-13 18:14:58 +08:00
parent ce6036329e
commit d2dc300290
45 changed files with 981 additions and 57 deletions

View File

@@ -173,7 +173,23 @@ public:
Java
```java
class Solution {
private int count = 0;
public TreeNode convertBST(TreeNode root) {
convert(root);
return root;
}
private void convert (TreeNode root) {
if (root == null) return;
convert(root.right);
count += root.val;
root.val = count;
convert(root.left);
}
}
```
Python
@@ -187,4 +203,4 @@ Go
* 作者微信:[程序员Carl](https://mp.weixin.qq.com/s/b66DFkOp8OOxdZC_xLZxfw)
* B站视频[代码随想录](https://space.bilibili.com/525438321)
* 知识星球:[代码随想录](https://mp.weixin.qq.com/s/QVF6upVMSbgvZy8lHZS3CQ)
<div align="center"><img src=../pics/公众号.png width=450 alt=> </img></div>
<div align="center"><img src=../pics/公众号.png width=450 alt=> </img></div>