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
What should be used when performing vehicle maneuvers?
IrinaVladis [17]

a wand .............

7 0
3 years ago
What is Sleep mode? Check all of the boxes that apply.
Liula [17]
Sleep mode (or suspend to RAM) is a low power mode for electronic devices such as computers, televisions, and remote controlled devices. These modes save significantly on electrical consumption compared to leaving a device fully on and, upon resume, allow the user to avoid having to reissue instructions or to wait for a machine to reboot. Many devices signify this power mode with a pulsed or red colored LED power light
Hibernation Edit
Main article: Hibernation (computing)
Hibernation, also called Suspend to Disk on Linux, saves all computer operational data on the fixed disk before turning the computer off completely. On switching the computer back on, the computer is restored to its state prior to hibernation, with all programs and files open, and unsaved data intact. In contrast with standby mode, hibernation mode saves the computer's state on the hard disk, which requires no power to maintain, whereas standby mode saves the computer's state in RAM, which requires a small amount of power to maintain.

Hybrid sleep Edit
Sleep mode and hibernation can be combined: the contents of RAM are first copied to non-volatile storage like for regular hibernation, but then, instead of powering down, the computer enters sleep mode. This approach combines the benefits of sleep mode and hibernation: The machine can resume instantaneously, but it can also be powered down completely (e.g. due to loss of power) without loss of data, because it is already effectively in a state of hibernation. This mode is called "hybrid sleep" in Microsoft Windows other than Windows XP.

A hybrid mode is supported by some portable Apple Macintosh computers,[1] compatible hardware running Microsoft Windows Vista or newer, as well as Linux distributions running kernel 3.6 or newer.

ACPI Edit
ACPI (Advanced Configuration and Power Interface) is the current standard for power management, superseding APM (Advanced Power Management) and providing the backbone for sleep and hibernation on modern computers. Sleep mode corresponds to ACPI mode S3. When a non-ACPI device is plugged in, Windows will sometimes disable stand-by functionality for the whole operating system. Without ACPI functionality, as seen on older hardware, sleep mode is usually restricted to turning off the monitor and spinning down the hard drive.
5 0
3 years ago
Alice sends a message to Bob in a manner such that Bob is the only person who can tell what the real message is. Which security
cupoosta [38]

Answer:

confidentiality

Explanation:

Alice sends a message to Bob in a manner such that Bob is the only person who can tell what the real message is. Which security concept is this an example of

3 0
3 years ago
Which of the following best describes how computing devices represent information ​
olganol [36]

Answer:

A system is which a computer is used to turn data into information best describes a computer-based information system.

A text code is a system that uses binary numbers (1s and 0s) to represent characters understood by humans (letters and numerals). y An early text codesystem, called EBCDIC, uses eight-bit codes, but is used primarily in older mainframe systems.

Data processing is simply the conversion of raw data to meaningful information through a process. ... Similar to a production process, it follows a cycle where inputs (raw data) are fed to a process (computer systems, software, etc.) to produce output (information and insights).

The central processing unit consists of electronic circuits that interpret and execute program instructions, as well as communicate with the input, output, and storage devices. It is the central processing unit that actually transforms data into information. Data is the raw material to be processed by a computer.

Explanation:

5 0
3 years ago
You must install JMP pro on your computer before attempting this assignment. You must use the data file: MedicalMalpractice.JMP.
Arte-miy333 [17]

Answer:

Mean = 91044.915

Median = 22750

Explanation:

See exhibit 1 in attachment for explanation.

6 0
3 years ago
Other questions:
  • What is the purpose of a title slide? A) To add titles to each slide B) To introduce the presentation C) To describe the resolut
    12·2 answers
  • C. why do manufacturers offer hard drive diagnostic software? what are the potential benefits of doing so to the manufacturer an
    13·2 answers
  • In a linux script, the line ____ is important because it identifies the file as a script.
    5·1 answer
  • The shortcut key to access the spelling and grammar check is _____.
    11·2 answers
  • Who was responsible for unleashing the melissa computer virus
    15·1 answer
  • To keep you from inadvertently moving controls as you work in the IDE, click the form or control, then click the _________ optio
    13·1 answer
  • Creating a Graphical User Interface in Java
    11·1 answer
  • What did creator Markus “Notch" Persson initially call his game
    14·2 answers
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    5·2 answers
  • What aspect should you consider before adding pictures to a document? You should structure the first before you search for a rel
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!