1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Olenka [21]
3 years ago
12

(Shuffle rows) Write a method that shuffles the rows in a two-dimensional int array using the following header: public static vo

id shuffle(int[][] m)
Computers and Technology
1 answer:
Lostsunrise [7]3 years ago
7 0

The question is incomplete. The complete question is :

Write a method that shuffles the rows in a two-dimensional int array using the following header: public static void shuffle(int[][] m)

Write a test program that shuffles the following matrix: int[][] m = {{1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}};

Solution :

//filename_suffle.java

#public class shuffle{

public_static_void_main_(String[] args) {

int[][] m = {{1, 2} {3, 4} {5, 6} {7, 8} {9, 10}};

System.out.println("Before shuffle");

displayMatrix(m);

System(dot)out(dot)println("After shuffle");

shuffle(m);

displayMatrix(m);

}

public_static_void_displayMatrix_(int[][] m) {

for (int i = 0; i < m.length; i++) {

for (int j = 0; j < m[i].length; j++) {

System.out.print(m[i][j] + " ");

}

System(dot)out(dot)println("");

}

}

public_static_void_shuffle_(int[][] m) {

int r1; // random row index

for (int i = 0; i < m.length; i++) {

for (int j = 0; j < m[i].length; j++) {

do {

r1 = (int)(Math.random() * m.length);

} while (r1 == i);

int[] temp = m[i];

m[i] = m[r1];

m[r1] = temp;

}

}

}

}

You might be interested in
Most licensing agencies offer an orientation meeting for applicants who want to obtain licensing for a child care facility or a
Eva8 [605]
The correct option is C.
Licensing agencies organised orientation meetings for those newly seeking day care facility license in order to educate  and familiarize them with the requirements that must be met and the laws and regulations that govern operating a day care facility. This orientation meeting usually equipped the participants with the information they need to succeed in the business.<span />
5 0
3 years ago
Read 2 more answers
A<br> is an list of steps to complete a task. *
nlexa [21]

Explanation:

hope it helps

pls mark me brainliest thanks

4 0
3 years ago
If person A creates an image with a creative common license. Person B then uses the image on his website. Who own the image and
Rudik [331]
Person A, of course. This person is the original maker of the image therefore that person has the rights to that image, person B does not automatically become the owner just by using it on his website. So the answer is person A.
3 0
3 years ago
Como interactua el hardware de la computadora con el ser humano
soldi70 [24.7K]

Answer:

Los humanos interactúan con las computadoras a través de una interfaz de usuario

7 0
3 years ago
What are two types of organizational structures designed to help an organization achieve its goals and objectives?
Fittoniya [83]

The answer is entrepreneurial and bureaucratic. Organizations that are large and small can achieve higher sales and other profit by properly matching their needs with the structure they use to operate.   the structure of an organization can help or hinder its progress toward accomplishing these goals and This are specific set up of organizations and ways to accomplish different goals. 

4 0
3 years ago
Read 2 more answers
Other questions:
  • Candace opened an email from a person she didn't know and clicked on a pop-up in the email that installed a virus on her compute
    8·2 answers
  • This type of connection uses radio waves to connect devices on a network.
    9·2 answers
  • A user states that when they power on their computer, they receive a "Non-bootable drive" error. The user works with external st
    8·1 answer
  • How many water bottles must be collected to win?
    8·2 answers
  • Write down the pseudo code of a program that calculates the Body Mass Index (BMI) of
    9·1 answer
  • Write any four difference between email and effects​
    14·1 answer
  • Helppppppppppp please
    5·2 answers
  • Which tab do you open to access the Comments feature?
    11·1 answer
  • Another name of computer program is
    6·1 answer
  • Why aren't my skullcandy bluetooth headphones connecting to my school chromebook if I turned on both the headphones and the blue
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!