Skeleton code for the K-ary tree