I have to make a special function where performance is a must
Given a sorted array of integers, I want to know :
- the number of integers who are unique
- the sum of those numbers
I have make such a function but, I guess, without performance because I pass the array twice.
I want a function who is passing the array one time.
The function could look :
private function sumunique(byref ar() as integer,byref number as integer) as integer
......
return sum
end function
Thanks for any response
Given a sorted array of integers, I want to know :
- the number of integers who are unique
- the sum of those numbers
I have make such a function but, I guess, without performance because I pass the array twice.
I want a function who is passing the array one time.
The function could look :
private function sumunique(byref ar() as integer,byref number as integer) as integer
......
return sum
end function
Thanks for any response
Last edited: