Extensible Firmware Interface Specification
H-28 12/01/02 Version 1.10
if (i < mN) {
*mSortPtr++ = (UINT16)i;
}
mHeap[1] = mHeap[mHeapSize--];
DownHeap(1);
j = mHeap[1];
if (j < mN) {
*mSortPtr++ = (UINT16)j;
}
k = Avail++;
mFreq[k] = (UINT16)(mFreq[i] + mFreq[j]);
mHeap[1] = (INT16)k;
DownHeap(1);
mLeft[k] = (UINT16)i;
mRight[k] = (UINT16)j;
} while (mHeapSize > 1);
mSortPtr = CodeParm;
MakeLen(k);
MakeCode(NParm, LenParm, CodeParm);
//
// return root
//
return k;
}