data structures using inserting an element in an array if an element has to be inserted at the end of an existing arraythen the task of insertion is quite simple we just have to add to the upper_ figure algorithm to append new element to an bound and assign the value herewe assume that existing array the memory space allocated for the array is still available for exampleif an array is declared to contain elementsbut currently it has only elementsthen obviously there is space to accommodate two more elements but if it already has elementsthen we will not be able to add another element to it figure shows an algorithm to insert new element to the end of an array in step we increment the value of the upper_bound in step the new value is stored at the position pointed by the upper_bound for examplelet us assume an array has been declared as step set upper_bound upper_bound step set [upper_boundval step exit int marks[ ]the array is declared to store the marks of all the students in class nowsuppose there are students and new student comes and is asked to take the same test the marks of this new student would be stored in marks[ assuming that the student secured markswe will assign the value as marks[ howeverif we have to insert an element in the middle of the arraythen this is not trivial task on an averagewe might have to move as much as half of the elements from their positions in order to accommodate space for the new element for exampleconsider an array whose elements are arranged in ascending order nowif new element has to be addedit will have to be added probably somewhere in the middle of the array to do thiswe must first find the location where the new element will be inserted and then move all the elements (that have value greater than that of the new elementone position to the right so that space can be created to store the new value example valuesdata[is an array that is declared as int data[ ]and contains the following data[{ }(acalculate the length of the array (bfind the upper_bound and lower_bound (cshow the memory representation of the array (dif new data element with the value has to be insertedfind its position (einsert new data element and show the memory representation after the insertion solution (alength of the array number of elements thereforelength of the array (bby defaultlower_bound and upper_bound ( datadata[ data[ data[ data[ data[ data[ data[ data[ data[ (dsince the elements of the array are stored in ascending orderthe new data element will be stored after at the th location soall the array elements from the th position will be moved one position towards the right to accommodate the new value