determining height of k-ary tree, given parent array