Clearing an array of defined element(s) - page 25

 
Sergey Dzyublik:

I would use HashSet data structure for value values.
The complexity would be: O(n) + O(m)

For the proposed binary search, the complexity would be: O(n log(m))


What library do you use for hash sets? The ones I've seen for MQL are slower than binary search ...

 

I have changed the test parameters (for the new task) to reflect a 2: 1 ratio of unique numbers to unique filters.
Files:
 

Minor changes.

P.S. slightly corrected

Files:
 

Open ArrayDeleteValue project.
Let's have some more fun

P.S. All functions are distributed in files. It's easier to edit each one

 

I would like to sincerely thank everyone from the bottom of my heart, in 10 years I have not seen a more productive thread on this forum!
Thank you all so much for your attention, for your concrete examples, for your constructive communication!
In my opinion this thread can be an example of how to communicate and help each other!
Thanks a lot again!

👍👍👍👍👍👍👍👍

 

I didn't want to offend anyone and I deleted the post where I responded to attacks about my algorithm, but I thought, that it should be clarified for programmers why it has wrong checksum and what is its difference from others - it simply keeps not only order of elements in array but their positions, of course, except for deleted ones.


In short, those who wrote code will understand whether it's useful or not, while proffesors don't be offended, but the site is not for you... :)

Очистка массива от заданного (ых) элементов
Очистка массива от заданного (ых) элементов
  • 2018.11.16
  • www.mql5.com
Есть массив содержащий набор данных по типу 1,2,3,6,9,5,6,3,25,6,8,7,4 нужно удалить например значения 3 и на выходе получить тот же массив без 3 и...
 
Ivan Negreshniy:

I didn't want to offend anyone and I deleted the post where I responded to attacks about my algorithm, but I thought, that it should be clarified for programmers why it has wrong checksum and what is its difference from others - it simply keeps not only order of elements in array but their positions, of course, except for deleted ones.


In short, those who wrote code will understand whether it's useful or not, while proffesors don't be offended, but the site is not for you... :)

I hinted somewhere above that there's no point in having a checksum at all. There's incoming data, there's a benchmark result.
It's necessary to compare the results of passes with the available, sure-fire reference. There is no need to compare two arrays O(n), the only benefit is to get an approximate result as soon as possible . The experimenter a little earlier (by a couple of seconds/minutes)
sifts out exactly the wrong results.

 
Konstantin Nikitin:

Project open ArrayDeleteValue.
Let's have some more fun

P.S. All functions are distributed across files. It is easier to correct each one.

different machines have different results, varying by almost a factor of two, so it's not even clear if it makes sense at all.

Ivan Negreshniy:

In short, those who wrote code will understand, it is useful or mistake, and professors do not be offended, but this site is not for you... :)

You're wrong, but you should probably read the thread before you enter it.

 
Ivan Negreshniy:

...

Yep, but otherwise beautiful marquise, all is well, all is well...

 
Stanislav Dray:

different machines have different results, varying by almost a factor of two, so it's not even clear if it makes sense at all.

you are wrong, but to understand it you probably need to read the thread before you enter it "from the foot"

if the correct way is to compare two algorithms about the same thing, then

- graphs are made. If at change of conditions (volume of an array for example) alg. A drawn in green clearly beats B drawn in blue, we can conclude that alg.A is "faster".

- You will also notice that the speed depends not only on the initial array size, but also on the number of elements to be deleted and even their location.

- i.e. the graphs are at least two-dimensional (that's surfaces) and it is necessary to look at the edge cases

as it is :-)