// Test a sort algorithm for data locality // by counting memory faults for various page sizes. // Use Monitored Array class (MArray) to tabulate faults. int p; #include #include #include #include "array.h" void pheap (int); void init(); // worst case input extern const int MAX= 10000; extern MArray a(MAX); ofstream out ("pheap.out", ios::out); void main () { int n; for (n=8; n<5000; n *= 2) { a.setSize (n); for (p=4; p