标签:highlight link list class att div tree blog java
class Solution { public void flatten(TreeNode root) { TreeNode cur=root, pre=null; while(cur!=null) { if(cur.left!=null) { pre=cur.left; while(pre.right!=null) pre=pre.right; pre.right=cur.right; cur.right=cur.left; cur.left=null; } cur=cur.right; } } }
114. Flatten Binary Tree to Linked List
标签:highlight link list class att div tree blog java
原文地址:http://www.cnblogs.com/asuran/p/7613475.html