Sort Boundary Elements Of A Matrix
ISC COMPUTER SCIENCE PRACTICALS 2009 BOUNDARY ELEMENTS Write a program to declare a matrix A[ ][ ] of order (m*n) where 'm' is the number of rows and n is the number of columns such that both m and n must be greater than 2 and less than 20. Allow the user to input positive integers into this matrix. Perform the following tasks on the matrix: (a) Sort the elements of the outer row and column elements in ascending order using any standard sorting technique. (b) Calculate the sum of the outer row and column elements. (c) Output the original matrix, rearranged matrix, and only the boundary elements of the rearranged array with their sum. Test your program for the following data and some random data. 1. Example : INPUT : M=3, N=3 1 7 4 8 2 5 6 3 9 OUTPUT : ORIGINAL MATRIX : 1 7 4 8 2 5 6 3 9 REARRANGED MATRIX : 1 3 4 9 2 5 8 7 6 BOUNDARY ELEMENTS : 1 3 9 8 4 5 7 6 SUM OF OUTER ROW AND OUTER COLUMN = 43 ISC COMPUTER SCIENCE PRACTICALS 2009 ...