top of page

Q: Is itpossible to define a union of disjoint lists?

Q:Is itpossible to define a union of disjoint lists?

Example:

x[0..9] <- list(30);

y[i in 0..4] <- union(x[i], x[2*i+1]);

so that

for [i in 0..4][k in 0..29]

contains(y[i], k) == max(contains(x[i],k), contains(x[2*i+1], k));


A:It is not possible to create directly a"union" object, but you can mimic its behaviour using arrays.

y[i in 0..4][k in 0..29] <- max(contains(x[i],k), contains(x[2*i+1], k);

最新記事

すべて表示
bottom of page