Say I have a ArrayList with n element in this array, and I add an element at the beginning:
myArrayList.add(0,\'some value\');
What will be the
ArrayList.add(0, element) takes linear time, but the constant is very low, because it can use the blazing fast System.arraycopy.
ArrayList.add(0, element)
System.arraycopy