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 17:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
You know the right answer?
Write a method public static void printRuns (int [] [] values, int runLength) that takes a 2D array...
Questions
question
Mathematics, 11.09.2021 03:50
question
Mathematics, 11.09.2021 03:50
question
Mathematics, 11.09.2021 03:50
question
Mathematics, 11.09.2021 03:50
question
Mathematics, 11.09.2021 03:50
question
Business, 11.09.2021 03:50
question
Computers and Technology, 11.09.2021 03:50
Questions on the website: 13722367