[algogeeks] Re: Finding common elements

2006-05-30 Thread gingernut
Thanks for your reply. These two lists keep changing on every iteration(every iteration gives a new sorted list),I have to find the common elements in two frest lists on every iteration. So if I create a hash table for one of the lists, then the hash table itself would have to be recreated

[algogeeks] Re: Finding common elements

2006-05-30 Thread gingernut
Amith, I did think of the summation that you mentioned, however it would take O(n) time to sum up the elements and a further O(n) to do the checking(the summed elements are not sorted) so it would totally take about O(n^2) which is not desirable.

[algogeeks] Re: Finding common elements

2006-05-30 Thread gingernut
However I have another problem, there may be 1 to 5 such coordinates in each list. will the has table become unweildy in such a case? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group.