Answer: nine years.
Explanation: according to the given prompt, the tree doubled its height each year, therefore we can also say that no matter what year we are in (in the ten years limit), the year before, the tree was half of its size. So, if the tree reaches its maximum height in ten years, that means that the year before that (year number nine), the tree was half of its maximum height. So the answer is nine years.