private: object * objects; int size;
Push_Back(E)
- Allocate a new array of objects one bigger.
- Copy all objects from the old array to the new one.
- Place E at the last location in the new array
- Delete the old array
private: object * objects; int size; int allocated;
Push_Back(E)
- If size = allocated
- Allocate a new array of objects size*2.
- Copy all objects from the old array to the new one.
- Delete the old array
- allocated <- size*2
- objects[size] <- E
- size <- size + 1