 To do this, the rows alternate between min heap and max heap.The algorithms are roughly the same, but, in each step, one must consider the alternating rows with alternating comparisons.The performance is roughly the same as a normal single direction heap.