Dynamic Array
– Task: Create a class that implements a Dynamic Array. The class
should implement the following method/constructor
• A constructor that allows for specifying a default size (default size
may or may not be given)
• addElement: Adds an integer to the array
• insert Element: Adds or inserts an integer at a given location
• delementElement: Deletes an integer from the element.
• size: Prints out the current size of the array
• count: Prints out the number of elements currently stored
• util: Prints out the utilization of the Array (size/count)
• shrink: delete unused location of the array (i.e., utilization is 100%)
• Print: Prints out the elements in an array
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |