Why and How insertion of new element in an arraylist is of O(1) when the capacity of our arraylist is full . I mean when the capacity is full we are creating another array of twice the size of previous arraylist and then copying each element from the previous arraylist to the newly created one and then we are adding the required element at the end of our list .So it may take O(n) time
Constant Time In add()
the amortised time complexity of insertion is O(1) and not the worst case time complexity. Worst case time complexity is still O(n )