Recent

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

Thaddy

  • Hero Member
  • *****
  • Posts: 14214
  • Probably until I exterminate Putin.
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 »
Specialize a type, not a var.

egsuh

  • Hero Member
  • *****
  • Posts: 1273
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