TreeShape function

Integer representing shape of a tree