1004 Improve GetLevel function by using recursive method which records level of each node along the tracking path up to the root thus avoiding repeatedly computing.