public void Insert(T key, double value) { _itemList.Add(key); value *= factor; if (value > mhd.min() || (value == mhd.min() && _index < mhd.getIndices()[0])) { mhd.changeMin(_index, value); } isSort = false; _index++; }
public static int[] heapSort(MinHeapDouble minHeap) { int[] newIndices = new int[minHeap.getIndices().Length]; int orgsize = minHeap.size; for (int i = 0; i < orgsize; ++i) { // Now sort newIndices[i] = minHeap.removeMin(); // removeMax places max value at end of heap } return(newIndices); }