Algorithm and Data Structure
Please code with C language
LABORATORY WORK Ne. Sorting algorithms Purpose of the laboratory work The purpose of laboratory work Ne5 is the assimilation of theoretical material and the acquisition of practical skills for solving the problem of sorting a given category of elements using different sorting algorithms in the two-dimensional arrays. Formulation of the problem 1. Given a two-dimensional array (matrix) of integers A[m, n) or A[n,n). where m and n are natural numbers (constants) that determine the dimensions of the two-dimensional array. Perform sorting of this array or a given part of it in a given order by a given algorithm (method). Sorting should be performed directly in a two-dimensional array "in the same place", ie, without overwriting the array and/or any part of it to other one or two- dimensional arrays, as well as without the use of list data structures. 2. Take the dimensions of the matrix m and n independently from 7 to 10 3. When testing the program it is necessary to select such input sets of initial values of a matrix that it was possible to trace correctly correctness of performance of sorting and this correctness would be tested for all possible cases. Smaller matrices may be used for testing purposes. Contents of the report 1. General statement of the problem and the task for a specific variant. 2. Program text. 3. Testing the program. When testing the program is necessary check the correctness of its work for the three cases of the initial state of the array or that part of it, which is sorted: already sorted the initial state of the array: unsorted initial state of the array (the array is filled with random numbers); inverted sorted (to the specified task) the initial state of the array. 4. As a result, print test data for all three cases of the initial state of the array or that part of it that is sorted 1 Variant No 10 Given a square two-dimensional array (matrix) of integers A [n, n]. Sort the side diagonal of the array by the algorithm No2 of the exchange method ("bubble sorting" using the "flag") in the ascending order