A
A
alez8882015-01-26 21:50:18
Pascal
alez888, 2015-01-26 21:50:18

How to sort a 2D array in Pascal?

Hello everyone, I ran into a small problem ... you need to sort a two-dimensional array in pascal by rows, taking the last element as a basis, for example:
at the input
1 2 3 4 2
1 5 2 9 3
3 5 2 9 6
at the output
3 5 2 9 6
1 5 2 9 3
1 2 3 4 2
How to carry out such a procedure?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2015-01-26
@gbg

Find the minimum string by starting from the first one. Exchange the first with the minimum.
Find the minimum string by starting the search from the second one. Exchange the second with the minimum.
Repeat until the end of the array.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question