I am terrible with algorithms but here goes
Suppose one wants to find, for a given list of distinct numbers, the sum of the products of every pair of different numbers in the list. For example, if the list consists of 4, 10, 20, 100 then we would compute 4*10 + 4*20 + 4*100 + 10*100 + 20*100 = 3720
The task is to write out an algorithm for the above calculation for an arbitrary list of n distinct numbers.
I am lost and don't know where to begin


LinkBack URL
About LinkBacks
