Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/ / Method to expand array public void expand ( int m , int n ) { int [ ] [ ] mazeCopy = maze;

//Method to expand array
public void expand(int m, int n){
int[][] mazeCopy = maze;
inIt(m, n);
for(int i =0; i < mazeCopy.length; i++){
System.arraycopy(mazeCopy[i],0, maze[i],0, mazeCopy[i].length);
}
}
write another class method called shrink similar to exand but where the new size of the table is actually smaller than the old one. It should have the same parameters as the functions expand, but the for loop should be bases on the new number of rows, and the nubmer of elements to be copied in the call to arrayCopy should be equal to the new number of columns.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions