prune merges all internal nodes starting with the deepest internal node and then the next deepest internal node and so on