Why kotlin does not provide ArrayDeque implementation?

The main feature of ArrayDeque (compared to ArrayList) is that it supports cheap adding/deleting at the front of the list (with wraparound). It means that a start index is needed (and wrap support) so most operations are slightly less efficient (more steps in calculating array index). Unfortunately Java architecture makes this a bit harder to implement fast than in C/C++ (but the JVM may have an intrinsic). So in Java I would expect possibly a tiny decrease in speed for operations not (add at start/remove from start)

1 Like