nearly complete binaryTree Train function