Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Algorithm and Data Structure
Please code with C language
image text in transcribed
image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

Define cash and cash equivalents. Give an example of each.

Answered: 1 week ago

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago