* * *

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

Thaddy

  • Hero Member
  • *****
  • Posts: 6374
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 »
I am enjoining wine, not whine....

egsuh

  • Full Member
  • ***
  • Posts: 111
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.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus