Now given 2D array will be stored contiguously in memory. So if access array elements using pointer, then i treat entire 2D as 1D array.Assume a[] is 1D array (with pointer), and n is the column length,for (j = 0; j2j+1; i--) {a[i] = a[i-1];}a[2j+1] = c;}Not sure how to do in Java as there is no pointer.
Now given 2D array will be stored contiguously in memory. So if access array elements using pointer, then i treat entire 2D as 1D array.
ReplyDeleteAssume a[] is 1D array (with pointer), and n is the column length,
for (j = 0; j2j+1; i--) {
a[i] = a[i-1];
}
a[2j+1] = c;
}
Not sure how to do in Java as there is no pointer.