I have a basic question on Java ArrayList.
When ArrayList is declared and initialized using the default constructor, memory space for 10 el
What happens is a new Array is created with n*2 spaces, then all items in the old array are copied over and the new item is inserted in the first free space. All in all, this results in O(N) add time for the ArrayList.
If you're using Eclipse, install Jad and Jadclipse to decompile the JARs held in the library. I did this to read the original source code.