ArrayDeque vs ArrayList to implement a stack
The main difference between both implementation is the resize strategy ArrayList is resized to a new size of oldCapacity + (oldCapacity >> 1), resulting in an increse of ~50%. The default capacity is 10, resulting in a capacities after resize of 15, 22, 33, 49, 73, 109, 163, 244, 366… ArrayDeque is always resized to … Read more