Question: Please draw the dynamic array stack structure (you must mention the size and capacity at each step) after the following commands 1-9 are executed. You
Please draw the dynamic array stack structure (you must mention the size and capacity at each step) after the following commands 1-9 are executed. You should assume that a resize doubles the capacity.
1. struct dynArr *stack = createDynArray(2);
2. pushDynArray (&stack, 2);
3. popDynArray (&stack);
4. pushDynArray (&stack, 4);
5. pushDynArray (&stack, 5);
6. pushDynArray (&stack, 11);
7. pushDynArray (&stack, 13);
8. pushDynArray (&stack, 2);
9. popDynArray (&stack);
You can type the answer in
[ ] [ ] size = , capacity =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
