So far 404 appears. when trying to download or view the script.
and I didn't see this standard algorithm:
void SortUp() { int n=ArraySize(arr); bool b=true; while (b) { b=false; for (int i=1; i<n; i++) { if (arr[i-1]>arr[i]) { double tmp=arr[i]; arr[i]=arr[i-1]; arr[i-1]=tmp; b=true; } } } }what is the analogue for it in this lib?
sergeev:
So such an algorithm was transformed into a more efficient "bubble", where for each cycle the value of N decreases by 1.
and I didn't see this standard algorithm:
what is the analogue for it in this lib?sergeev:
There is no analogue. I added it, called it Simple. It's quite slow.
and I didn't see this standard algorithm:
what's the analogue for it in this lib?
Files:
sSortTest_v2.mq5
17 kb
- What place does the standard ArraySort take in the list?
- I would like to have in MQL5 a universal standard function for sorting arrays of any type by any condition (as it is done in C++ and similar). Unfortunately, the lack of pointers in MQL5 makes it difficult to write such a function.
Colleagues, I suggest (for future articles) to record video additionally, in my opinion it will be much clearer than reading.
example
well, or at least envy the heading interesting programming video, by analogy with interesting financial video... for it will be somehow not rational to put everything in one pile, like this video....
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register

sSortTest:
The script contains several sorting methods for sorting of double[] array:
Sorting algorithms performance:
Author: Дмитрий
Fig. 1. Sort algorithms performance
The fastest sort method is Hoar sort (Quick sort), but it's recursive and needs a careful use.