// IntArray.cc // 4 March 12002 // Robert Baertsch #include "IntArray.h" #include #include IntArray::IntArray(int size ) { Ints = new int[size]; AllocInts = size; NumInts = 0; } IntArray::IntArray(const IntArray &A) { Ints = new int[A.NumInts]; AllocInts = A.NumInts; NumInts = A.NumInts; for(int i=0; i AllocInts) { Realloc(A.NumInts); } NumInts = A.NumInts; for(int i=0; i= AllocInts) { int new_size = (AllocInts>5)? 2*AllocInts: 10; Realloc(new_size); } Ints[NumInts++] = newelem; } void IntArray::Realloc(int newsize) { assert(newsize < 10000000); assert(newsize>=NumInts); int * newset = new int[newsize]; for(int i=0; i