#include "Vector.hpp" Vector::Vector(int length) { size = length; array = new (nothrow) int[size]; if(array==NULL) { cerr << "Memory allocation failure!" << endl; exit(-1); } for(int i=0; ilength(); array = new (nothrow) int[size]; if(array==NULL) { cerr << "Memory allocation failure!" << endl; exit(-1); } for(int i=0; ivalueAt(i); } Vector::~Vector() { delete [] array; } int Vector::length() const { return size; } int &Vector::valueAt(int pos) const { if(pos>=length()) { cerr << "Invalid access position!\n"; return array[size-1]; } return array[pos]; } int Vector::find(int a) const { for(int i=0; i