leetcode 114. Flatten Binary Tree to Linked List
来源:互联网 发布:redcountdown.js 编辑:程序博客网 时间:2024/06/07 07:01
Morris Traversal
class Solution {public:void flatten(TreeNode* root){while (root){if (root->left){auto p = root->left;while (p->right){p = p->right;}p->right = root->right;root->right = root->left;root->left = nullptr;}root = root->right;}}};
0 0
- LeetCode: Flatten Binary Tree to Linked List
- LeetCode Flatten Binary Tree to Linked List
- LeetCode: Flatten Binary Tree to Linked List
- [Leetcode] Flatten Binary Tree to Linked List
- [LeetCode] Flatten Binary Tree to Linked List
- Leetcode: Flatten Binary Tree to Linked List
- leetcode Flatten Binary Tree to Linked List
- LeetCode Flatten Binary Tree to Linked List
- LeetCode - Flatten Binary Tree to Linked List
- 【leetcode】Flatten Binary Tree to Linked List
- [LeetCode]Flatten Binary Tree to Linked List
- [Leetcode]Flatten Binary Tree to Linked List
- [leetcode]Flatten Binary Tree to Linked List
- LeetCode-Flatten Binary Tree to Linked List
- [leetcode] Flatten Binary Tree to Linked List
- LeetCode - Flatten Binary Tree to Linked List
- LeetCode:Flatten Binary Tree to Linked List
- [LeetCode] Flatten Binary Tree to Linked List
- Mycat之——配置文件schema.xml
- Python中的__name__和__main__含义详解
- ANDB bionic版本release 注意事项
- 感概
- HM编码器代码阅读(36)——帧内预测(三)帧内预测之参考像素块的预处理和滤波
- leetcode 114. Flatten Binary Tree to Linked List
- spring boot tomcat jsp
- 在linux下创建自定义服务
- 一段spring4的配置
- C++ 内存分配(new,operator new)详解
- Android开发之初识Camera图像采集
- JVM学习之:调优总结 -Xms -Xmx -Xmn -Xss
- c++中vector的用法详解
- github代码搜索技巧