(int[] nums, int l, int r)
| 12 | return root; |
| 13 | } |
| 14 | public int max(int[] nums, int l, int r) { |
| 15 | int max_i = l; |
| 16 | for (int i = l; i < r; i++) { |
| 17 | if (nums[max_i] < nums[i]) |
| 18 | max_i = i; |
| 19 | } |
| 20 | return max_i; |
| 21 | } |
| 22 | /*public TreeNode constructMaximumBinaryTree(int[] nums) { |
| 23 | // https://leetcode.com/problems/maximum-binary-tree/discuss/106146/C++-O(N)-solution |
| 24 | Stack<TreeNode> stack = new Stack<>(); |
no outgoing calls