Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在从给定的前序遍历构造二叉搜索树时,我们不能使用普通方法从一组数组值构造 BST,而不是遵循这里给出的方法。如果不是,请给出我的方法失败的反例。谢谢!
你可以!从前序遍历构造 BST 时,对算法而言重要的是值本身存在并且可以访问。一组数组值应该可以完美运行!