Adding code to read the array of node values to build the tree.