The height of a rooted tree is the maximum of the levels of its vertices or the length of the longest path from the root.