Description: * establish the tree with the following principles:
* 1. the father of each number is the first larger number on its left and the smaller one on its right, the first one larger than it
* 2. if a number is infinite on the left, it's not on the right. That is to say, this number is the maximum in the entire number
* * /
How / / as soon as possible to find out each one on both sides of the first larger number? Using stack
Find / left, from left to right through each number, keep the descending order of the stack, the new data kept by the pop from the top of the stack, the stack until the new number or number ratio
Find / right, from right to left traverse each number, keep the descending order of the stack, the new data kept by the pop from the top of the stack, the stack until the new number or number ratio
To Search:
File list (Check if you may need any files):
java_code
java_code\MaxTree.java