This is queue data structure with heapsort