2007/8/10, Ashish Kulkarni <[EMAIL PROTECTED]>: > Hi > I have a program which creates permutations for 10 letters, so the values i > get is 10 ^10 which is more then 3 million
Do you mean permutations (the same letters ordered in different ways) or dispositions with repetition (the 10-letter group can be taken from the 26 letters of the alphabet, can be repeated and can stay in any order)? Permutations: 10! possibilities Dispositions with repetition: 26^10 > Now i have to go through all 3 million records and do some calculations to > determine the best possible combination . > > Any ideas what i should use, LinkedList, ArrayList, HashMap, > what would be the best way performance wise > > should i use primitive or objects for calculations. > Any suggestions on approaching this problem. IMHO it's better not to do it! :-) AFAICT, either way you are using permutations or dispositions with repetition, it is a O(e^n) problem, i.e. exponential complexity. I think that you need to change the problem, or solve it in another way, to go down to polynomial complexity. The answer, then, is that the complexity does not depend on the array-like structure you are using. Just my 0.02 euros. Antonio --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

