Vector
Vector
bool isFull() {
return (elmCount == capacity);
}
bool isEmpty() {
return (elmCount == 0);
}
public:
Vector() : capacity(10), vect(new int[capacity]) {} //default size array of
size 10
if (loc != -1) {
for (int i = loc; i < elmCount - 1; i++) { //from the elm to
delete onwards
vect[i] = vect[i + 1]; //copy every next elm to the
previous index
}
elmCount--;
dynamicShrink();
}
}
int main(){
Vector vect(3);
vect.display();
vect.deleteElm(3);
vect.display();
vect.replace(1, 5);
vect.replaceAtIndex(3,2);
vect.display();
}