sorts generic linked list using min-heap sort algorithm