E
E
Evgeny Ivanov2017-01-12 09:35:42
Delphi
Evgeny Ivanov, 2017-01-12 09:35:42

How to quickly sort a large array?

Not good at sorting. (
How to quickly sort a large array in Delphi?
There is a two-dimensional array consisting of 10.000 entries.
SOME_TABLE:array of array [1..37] of string;
The 37th element of the array is "number". (i.e. a string like 1,2,3...100)
You need to sort the array from smallest to largest Here is the
quicksort code
www.delphi-manual.ru/qsort.php
But first of all, I have a two-dimensional array, and secondly, it is not defined in the type section, but usually in the var section
. programs (a lot of other code, a different task and algorithm).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kalapanga, 2017-01-12
@kalapanga

If you do not pay attention to the complete confusion about type and var, then the problem boils down to the following - the correct formulation of the problem. If you have elements of an array of numbers, then it is clear how to compare them with each other, which one is larger and which one is smaller. For strings, too, everything is not difficult. And you have the elements of the sorted array - arrays. How are you going to compare them? Criterion? How do you define whether one array is "greater" or "less than" another? You can do something similar to comparing strings, but you know better!
If you decide on this, then you can easily apply any sorting method you like to your table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question