data structures using middle of the array to do thiswe must first find the location from where the element has to be deleted and then move all the elements (having value greater than that of the elementone position towards left so that the space vacated by the deleted element can be occupied by rest of the elements example valuesdata[is an array that is declared as int data[ ]and contains the following data[{ }(aif data element with value has to be deletedfind its position (bdelete the data element and show the memory representation after the deletion solution (asince the elements of the array are stored in ascending orderwe will compare the value that has to be deleted with the value of every element in the array as soon as val data[ ]where is the index or subscript of the arraywe will get the position from which the element has to be deleted for exampleif we see this arrayhere val data[ which is not equal to we will continue to compare and finally get the value of pos ( datadata[ data[ data[ data[ data[ data[ data[ data[ algorithm to delete an element from the middle of an array step [initializationset pos step repeat steps and while < step set [ia[ step set [end of loopstep set step exit figure the algorithm delete will be declared as delete(anposthe arguments arealgorithm to delete an element from the middle of an array datadata[ data[ data[ data[ data[ datadata[ data[ data[ data[ data[ datadata[ data[ data[ data[ data[ datadata[ data[ data[ data[ data[ datadata[ data[ data[ data[ figure deleting elements from an array (aathe array from which the element has to be deleted (bnthe number of elements in the array (cposthe position from which the element has to be deleted figure shows the algorithm in which we first initialize with the position from which the element has to be deleted in step while loop is executed which will move all the elements having an index greater than pos one space towards left to occupy the space vacated by the deleted element when we say that we are deleting an elementactually we are overwriting the element with the value of its successive element in step we decrement the total number of elements in the array by nowlet us visualize this algorithm by taking an example given in fig calling delete (data will lead to the following processing in the array