Template Function ADS::fromPreorderInorder

Function Documentation

template<class T>
BinaryTree<T> *ADS::fromPreorderInorder(const std::vector<T> &pre, const std::vector<T> &in)

fromPreorderInorder(): the binary tree whose previsit is pre and whose invisit is in, nil if they are empty; O( n ) time; the caller owns it

Pre:

pre and in are the visits of a binary tree of distinct values