Q: Is itpossible to define a union of disjoint lists?
- MSI株式会社
- 2022年5月14日
- 読了時間: 1分
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);
Comments