Computer Science, asked by avi010, 10 months ago

Insertion in c++ Data structure!!!⚠️ don't spam requesting!!​

Answers

Answered by Anonymous
4

Insertion:- In data structure , insertion helps you to insert data at specified position.

Insertion code:-

void Insert(int a[], int n, int item, int POS)

{

int i;

for(i = n; i>=pos-1; i --)

a[i] = a[i - 1];

a[POS-1]=item;

cout<<"Now Array is: " <<endl;

for(i=0;i<=n;i++)

cout<<a[i]<<endl;

}

Similar questions