Name: _____________________________________________ Honor Code Acknowledgment: _______________________ Random Quiz # 8 CPS 100, Fall 1994 November 4, 1994 problem : Ed Jones What is the minimum height of a binary tree that contains 31 nodes? What is the maximum height of a binary tree that contains 31 nodes? problem : Ed Gaedel What is the minimum height of a binary tree that contains 1,023 nodes? What is the maximum height of a binary tree that contains 1,023 nodes? problem : Bo Diddley Squat Consider a tree in which each node contains a maximum of 4 children (a quad tree). What is the minimum height of a quad tree that contains 21 nodes, what is the maximum height of a quad tree that contains 21 nodes? problem : Bicep,Tricep What is the minimum height of a quad tree that contains 21,845 nodes? problem : Peas and Billiard Sticks Write the body of the constructor for the class PQueue, a priority queue of integers, whose declaration is given below. This should involve assigning to all three private data members. void PQueue::PQueue(int size) { } The following declarations for a PQueue class for priority queues of integers are used in the previous problem class PQueue { public: Pqueue(int size); // make heap of size elements ~Pqueue(); // destructor int Insert(int elt); // return 1 if successful, else 0, insert elt int Min(); // return min element int DelMin(); // return and remove min element int Size(); // return # of elements in pqueue int IsEmpty(); // 1 if empty, else 0 private: int * elements; // array for heap implementation (start at 1!) int heapSize; // # of elements in heap int maxSize; // maximum size of heap };