What is a memory-efficient way to store a vector of integers? Follow-up question: using your proposed data structure, find an algorithm with constant memory usage to calculate the dot product of two vectors.
Sigiloso
Could be simply an array (though ArrayList is also fine since it is almost the same). The operation of dot product is just as easy as it could be, with the constant extra memory equaling one integer for storing the result.