Set: Difference between revisions

Content added Content deleted
(Added solution for Action!)
(add BQN)
Line 854: Line 854:
Set A is not equal to set B
Set A is not equal to set B
</pre>
</pre>

=={{header|BQN}}==

BQN can use lists with only unique elements to represent sets. The following implement all the basic set relations.

<lang bqn>Union ← ⍷∾
Inter ← ∊/⊣
Diff ← ¬∘∊/⊣
Subset ← ∧´∊
Eq ← ≡○∧
CreateSet ← ⍷

•Show 2‿4‿6‿8 Union 2‿3‿5‿7
•Show 2‿4‿6‿8 Inter 2‿3‿5‿7
•Show 2‿4‿6‿8 Diff 2‿3‿5‿7
•Show 2‿4‿6‿8 Subset 2‿3‿5‿7
•Show 2‿4‿6‿8 Eq 2‿3‿5‿7
•Show CreateSet 2‿2‿3‿5‿7‿2</lang><lang>⟨ 2 4 6 8 3 5 7 ⟩
⟨ 2 ⟩
⟨ 4 6 8 ⟩
0
0
⟨ 2 3 5 7 ⟩</lang>


=={{header|C}}==
=={{header|C}}==