Tag - heap sort algorithm