Array_ADT/arra_adt.cpp
// this function will the element at a given index
// and return the value stored in the x
this function will the element at a given index
and return the value stored in the x
this function will the element at a given index and return the value stored in the x
int delete_arr(struct Array *arr, int index)
{
    int x=0;
    if(index>=0 && index<= arr->length)
    {
        x=arr->A[index];
        for(int i=index;i<arr->length;i++)
        {
            arr->A[i]=arr->A[i+1];
        }
        arr->length--;
        return x;
    }
    return -1; 
}
int delete_arr ( struct Array * arr , int index ) { int x = 0 ; if ( index >= 0 && index <= arr -> length ) { x = arr -> A [ index ] ; for ( int i = index ; i < arr -> length ; i ++ ) { arr -> A [ i ] = arr -> A [ i + 1 ] ; } arr -> length -- ; return x ; } return -1 ; }
this function will the element at a given index
and return the value stored in the x
this function will the element at a given index and return the value stored in the x
//