Recursive function to construct binary tree of size lenn from Inorder traversal in and Preorder traversal pre [ ] . Initial values of inStrt and inEnd should be 0 and lenn - 1. The function doesn 't do any error checking for cases where inorder and preorder do not form a tree
def buildTree ( inn , pre , inStrt , inEnd ) : NEW_LINE INDENT global preIndex NEW_LINE if ( inStrt > inEnd ) : NEW_LINE INDENT return None NEW_LINE DEDENT DEDENT