minmax tree