subject

Write a method public static void printRuns (int [] [] values, int runLength) that takes a 2D array of integers and prints out which rows and columns (and/or parts of rows and columns) contain runs of length runLength. A run is a group of identical consecutive values. For example 7, 7, 7is a run of length 3. Each print-out must clearly indicate which part of a row or column contains the run. The example method call outputs given below will help to clarify what the method does and what its output should be. In the output, assume that the row and column numbering begins at 0, not 1. You may assume that the values array is rectangular (i. e., not ragged) For the examples below, suppose we have the following 2D array: int [] [ = new int [] [] { nums2D 5, 5, 0, 5, 2}, 1, 2, 2, 2, 2}, 2, 4, 2, 2, 2}, 2, 2, 2, 2, 2}, 3, 3, 2, 2, 2}, {4, 4, 2, 2, 0}, 4, 2, 2, 2, 8}};
Method call: printRuns (nums2D, 4);
Expected output:
Row 1, columns 1 - 4
Row 3, columns 0 - 3
Row 3, columns 1 - 4
Column 2, rows 1 4
Column 2,
Column 2, 5 rows 2 rows 3
Column 3, rows 1
Column 3, 5 rows 2
Column 3, rows 3 - 6
Column 4, 3 rows 0
Column 4 rows 1- 4
Method call: printRuns (nums2D, 5)
Expected output:
Row 3, columns 0
Column 2, 5 rows 1
Column 2, 6 rows 2
Column 3, 5 rows 1
Column 3, rows 2
Column 4, rows 0- 4
Method call: printRuns (nums2D, 6); Ln 4Ln LO LO
Expected output:
Column 2, rows 1 - 6
Column 3, rows 1 - 6
Method call: printRuns (nums 2D, 7);
Expected output:
(no output

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:30
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
On early television stations, what typically filled the screen from around 11pm until 6am? test dummies test patterns tests testing colors
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
You know the right answer?
Write a method public static void printRuns (int [] [] values, int runLength) that takes a 2D array...
Questions
question
Biology, 07.12.2019 21:31
question
Mathematics, 07.12.2019 21:31
Questions on the website: 13722367