TreeNode constructor for add node.data[k] to self.