Say, a pair of leaves has been assigned 1 and 3 respectively. The parent of the pair is accordingly assigned (1,3) -> 5 (considering 1 and 3 maps to 5 given h). So 53rd ( or any ) leaf changed to a different value, say, 4, eventually maps to (1,4) so the h must be recomputed for the parent once. The change is parent requires another recomputation for the parent above, and so on till the root is recomputed. So the height of the tree is the number of times, the value is recomputed.