Question: When storing pairs using the triangular-matrix method, we store in a[k] the count for the pair {i, j} with 1 i < j n where
When storing pairs using the triangular-matrix method, we store in a[k] the count for the pair {i, j} with 1 i < j n where k = (i 1)(n i/2) + j i. Derive a formula to do something similar in order to assign one unique position, in a linear array, of triples {i, j, l} where 1 i < j < l n. That is, you should come up with a formula for where in the linear array to store each given triple.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
