Matrix: print the elements in a sorted order
Heaps