The structure performs as well as a fixed array for indexed access
The structure can "grow" (it is dynamic) -- i.e. it supports adding/removing/inserting elements
Note that you do not need to implment "shrink", but you may do so for fun, it would be the opposite of grow. When the structure becomes "oversized" (e.g., capacity/size > 3) you would then shink the capacity back down to (size * growthFactor)
No external logic (e.g. "code libraries", etc) is allowed -- that means we will not use the Java library packages (i.e., we will not use the "java.util" package or any others) -- the only exceptions are that the Java package "java.util.function" may be used and the provided method "toArray" uses a couple Java classes as described in its method comment
The grader will expect the provided directory structure be intact (i.e., do not "move" the provided files)
The default initial capacity of the dynamic array must be 10 (as suggested in the last chapter)
For DynamicArray:
In the provided file "DynamicArray.java", replace "//TODO" with your methods and logic
See the comment at the top of DynamicArray.java
The class header is completed for you -- do not modify the header - the grader will expect it exactly as-is (as provided)
The static factory methods are completed for you - the grader will expect those headers be exactly as-is (as provided)
The method "toArray" is completed for you
Data Structures And Algorithms (DSA)
(Chapter 305 - Dynamic Array Code Challenge)