Content deleted Content added
Fresheneesz (talk | contribs) |
Fresheneesz (talk | contribs) |
||
Line 13:
'''function''' insertEnd(''dynarray'' a, ''element'' e) {
'''if''' (a.size = a.capacity) {
/* resize a to twice its current capacity */
a.capacity := a.capacity × 2;
/* increasing capacity often requires reallocating
memory in a different ___location; then we will need
to copy the contents to the new ___location here */
}
a[a.size] := e;
|