Array_ADT/arra_adt.cpp
// this function will insert an element 'x' at a given index in that array
// by shifting the elements if presesnt at that index
this function will insert an element 'x' at a given index in that array
by shifting the elements if presesnt at that index
this function will insert an element ' x ' at a given index in that array by shifting the elements if presesnt at that index
void insert_at(struct Array *arr, int index, int x)
{
    if(index>=0 && index <= arr->length)
    {
        for(int i=arr->length; i>index;i--)
        {
            arr->A[i]=arr->A[i-1];
        }
        arr->A[index]=x;
        arr->length++;
    }
}
void insert_at ( struct Array * arr , int index , int x ) { if ( index >= 0 && index <= arr -> length ) { for ( int i = arr -> length ; i > index ; i -- ) { arr -> A [ i ] = arr -> A [ i - 1 ] ; } arr -> A [ index ] = x ; arr -> length ++ ; } }
this function will insert an element 'x' at a given index in that array
by shifting the elements if presesnt at that index
this function will insert an element ' x ' at a given index in that array by shifting the elements if presesnt at that index