addfirst(eadd( ,eaddlast(eadd(size(),eremovefirst(remove( removelast(remove(size( simple array-based implementation an obvious choice for implementing the array list adt is to use an array awhere [istores ( reference tothe element with index we choose the size of array sufficiently largeand we maintain the number of elements in an instance variablen the details of this implementation of the array list adt are simple to implement the get(ioperationfor examplewe just return [iimplementations of methods add(ieand remove(iare given in code fragment an important (and time-consumingpart of this implementation involves the shifting of elements up or down to keep the occupied cells in the array contiguous these shifting operations are required to maintain our rule of always storing an element whose list index is at index in the array (see figure and also exercise code fragment methods add(ieand remove(iin the array implementation of the array list adt we denotewith nthe instance variable storing the number of elements in the array list