Recent

Author Topic: Can this algorithm be made more efficient?  (Read 18809 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Can this algorithm be made more efficient?
« Reply #60 on: July 10, 2018, 05:36:13 pm »
What is your intended result, if

set1 = [5];
set2 = [5,5,5];    // this is possible as this is array, net set.


Then should the result (num)  1.5?
Obviously you are not proficient in Pascal. < >:D >:D>

My code does what it says.
« Last Edit: July 10, 2018, 06:25:51 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

egsuh

  • Hero Member
  • *****
  • Posts: 1289
Re: Can this algorithm be made more efficient?
« Reply #61 on: July 13, 2018, 01:48:48 pm »
I know my syntax is wrong. I'm just asking what is the INTENDED result.

In the original example, some figures (17.5 and 17.6) of set2 appear twice.  And based on the LOGIC of the original example, any number in the set1 which is larger than the figures appearing more than once in the set2 will gain two or more points.

I'm just asking this is the intended result.

 

TinyPortal © 2005-2018