// File: farray.h // // An extension of the array class to handle file I/O // and binary search. #include "array2.h" class FArray : public Array { // public derivation of Array class public: FArray() ; // Default constructor FArray(int n, long seed=0) ; // Alternate constructor ~FArray() ; // Destructor FArray(const FArray&) ; // Copy constructor FArray& operator=(const FArray&) ; // Assignment FArray(const char *) ; // construct from a file bool write(const char *) ; // output to a file void sort() ; // sort this array int bsearch(DATA) ; // perform binary search protected: char *fname ; int bsearch(DATA, int, int) ; // recursive binary search void quicksort(int, int) ; // quicksort used by sort int partition(int, int) ; // partition used by quicksort } ;