jonvolfson / cs4500-api

0 stars 1 forks source link

Need a push_back() method stub #10

Open NickSimmons97 opened 4 years ago

NickSimmons97 commented 4 years ago

My partner and I believe that an array needs to support element adding to the end of an array (i.e. adding element without specifying an index). The spec states- "Arrays should grow when values are pushed back, and otherwise support reads and writes." Would it be possible for you to add a void push_back(void* obj); method stub? Thanks for considering.

jonvolfson commented 4 years ago

We're in class and won't be able to look at this until 3:30ish. We'll push updates then. We'll go with the assumption that adding an element to the array doubles its size when capacity is reached. What are your thoughts on decreasing the size of the array if lots of items are removed? If you have other ideas please let me know.

NickSimmons97 commented 4 years ago

yes, doubling the size when capacity is reached sounds good. We do not see a need to decrease the size at this moment in time.

destae commented 4 years ago

We will have a function called append(void* obj) we will be trying to push an update within the next 10 minutes