On finding connected balanced partitions of trees