← 返回 meta 的题目列表Constructing Max Tree from Reverse Ordered Array and Traversal
类型:online_judge
meta
Given an integer array, construct a binary tree such that each node's value is greater than its children. The tree should be built recursively starting with the largest number as the root. If the input is a reverse ordered array, describe the steps to construct the tree and which traversal would return the original array order.
Example
Input
5
5 4 3 2 1