// supporting functions - for paging heaps #include "array.h" #include extern MArray a; extern int p; int first (int); int pow (int,int); void adjust (int & n) // Adjust the array to allow for a "hole" at the end of each page // adjustment is needed only for paging heaps. {int k,shift,an; an = n; // ?? shift = n / (p-1); n = an + shift; for (k=an-1; k>=p-1; k--) { a[k+shift] = a[k]; if ((k+shift) % p == 0) shift--; } a.setSize (n); } void unadjust (int & n) // Undo the adjustment made to the array for paging heaps. // "Remove" the hole at the end of each page, compressing the array. { int k, shift = 1; k = p-1; while (k