previous exercisethe following series of operations takes (ntime(in push operations on an array list with initial capacity (iin pop (removal of the last elementoperations - show how to improve the implementation of method add in code fragment so thatin case of an overflowthe elements are copied into their final place in the new arraythat isno shifting should be done in this case - consider an implementation of the array list adt using an extendable arraybut instead of copying the elements of the array list into an array of double the size (that isfrom to nwhen its capacity is reachedwe copy the elements into an array with / additional cellsgoing from capacity to / show that performing sequence of push operations (that isinsertions at the endstill runs in (ntime in this case - the nodepositionlist implementation given in code fragments does not do any error checks to test if given position is actually member of this particular list for exampleif is position in list and we call addafter(peon different list tthen we actually will add the element to just after describe how to change the nodepositionlist implementation in an efficient manner to disallow such misuses - suppose we want to extend the sequence abstract data type with methods indexofelement(eand positionofelement( )which respectively return the index and the position of the (first occurrence ofelement in the sequence show how to implement these methods by expressing them in terms of other methods of the sequence interface - give an adaptation of the array list adt to the deque adt that is different from that given in table - describe the structure and pseudo-code for an array-based implementation of the array list adt that achieves ( time for insertions and removals at index as well as insertions and removals at the end of the array list your implementation should also provide for constant-time get method (hint