摘要:
class Solution { Node pre, head; public Node treeToDoublyList(Node root) { if(root == null) return null; dfs(root); head.left = pre; pre.right = head; 阅读全文
摘要:
// Encodes a tree to a single string. public String serialize(TreeNode root) { if(root == null) return "[]"; Deque<TreeNode> deque = new LinkedList<>( 阅读全文