Question: ) Write a method named matrixSort which takes an FxF matrix and print the row of the matrix in ascending and descending order alternatively.
) Write a method named matrixSort which takes an FxF matrix and print the row of the matrix in ascending and descending order alternatively. Explanation: The first row is sorted in ascending order, second row sorted in descending order, third row sorted in ascending order and so on. Int mat100={{5, 7, 3, 4). (9,5,8,2). (6, 3, 8, 1). (5,8,9,3)); matrix Sortmat); Output: 3457 9852 1368 9853 int mat20]={{7, 3, 4), (3,8,2), (3, 6, 1)); matrix Sortmat2): Output: 347 832 136
Step by Step Solution
3.43 Rating (150 Votes )
There are 3 Steps involved in it
CODE public class Main private static void matrixsortint mat1 for in... View full answer
Get step-by-step solutions from verified subject matter experts
