Currently Being Moderated
Let be a set of pairs, A = {(double#1, integer#1), ..., (double#n, integer#n)}, or short noted (double#i, integer#i), i = 1..n ,
Association between pair members must be maintained, after sorting A, in the doubles ascending order.
Let be now another set of pairs, B = {(Object#1, integer#1), ..., (Object#n, integer#n)}, or short noted (Object#i, integer#i), i = 1..n,
where integer#i, i = 1..n, is the same in both sets.
Also, let be an eliminateDoubleBySomeObjectComparisonStuff(Object#1, Object#2) method for testing Object#2 against Object#1 in B, if a pair (double#2, integer#2) is allowed to be accepted together with (double#1, integer#1) in A.
N.B. It could be considered in fact a set of tri-components objects, (double#i, integer#i, Object#i), i = 1..n, but I think it's more clear a separation between sets A and B, because of the two separated operations, doubles sorting and elimination method.
Finally, the complete algorithm:
for i -> 1..n to double#i (from A) do
for j -> i + 1 to double#j (from A) do
eliminateDoubleBySomeObjectComparisonStuff(Object#i, Object#j)
Question which stays is... what data structure can be used to achieve these? How can be sorted doubles in question, without loose association with corresponding integers, implicitly with corresponding objects, and then applied elimination method on doubles data structure twice, simultaneously, considering a comparison condition between objects?
Edited by: Lucian2 on May 29, 2013 6:22 AM
Edited by: Lucian2 on May 29, 2013 6:23 AM
Edited by: Lucian2 on May 29, 2013 6:24 AM
Edited by: Lucian2 on May 29, 2013 6:25 AM