Insertion-sort works also on unordered array, like the example here shows. This statement in the title (or here) for some odd reason requires that you have an ordered array to implement priority-queue for the insertion sort, why does it have such requirement? What does this Wikipedia -thing here actually mean (the below screenshot)?

The article relates the usage of priority queue for sorting and how different implementations of priority queue correspond with familiar sorting algorithms.
Let us consider ADT priority queue with operation
pop()which takes out the “smallest” element as defined by a comparison function andpush()which put a new element in the priority queue. Then sorting can be done by callingpush()to push all elements in the unsorted array into the priority queue and callingpop()until the priority queue is empty and put the popped out element into an array (well, you can define a methodempty()to check whether the ADT is empty).Psuedocode:
Then we talk about how to implement the priority queue. Typically, it is efficiently implemented with heap. However, it is not necessary to be heap – you can implement it in less efficient ways, which is with unordered array or ordered array as mentioned in Wikipedia article. As long as the implementation satisfy the requirement for the
push()andpop()operations then it is fine.For unordered array, you can
push()by placing the element directly just after the last element – since it is unordered. When youpop(), since the array is unordered, you need to search through the whole array and pick out the largest element. (Removal can be done easily, by swapping the last element in the unordered array to the position of the element being popped out). It is similar to selection sort, since you are essentially go through the list of unsorted elements (which is in the priority queue) and pick out the largest element to put into sorted portion.You can see that insertion operation in insertion sort is being done in the
push()operation here.For ordered array, you can
pop()by just taking out the first element (removal can be done easily by maintaining a starting index). Butpush()will require you to find out where to place the element to maintain the order (since it is an ordered array). This is the part where it closely resembles insertion sort, since you are trying to insert the current element to the sorted portion (the priority queue implemented as ordered array).You can see that selection operation in selection sort is being done in the
pop()operation here.