Update TreeNode and create ListNode.