Jump to content

Symmetric difference: Difference between revisions

(→‎{{header|Lua}}: Shortened Lua OO-version)
Line 1,313:
Difference A\B : {Serena}
Difference B\A : {Jim}
 
=={{header|Maple}}==
Maple has built-in support for set operations. Assign the sets A and B:
<lang Maple>
A := {John, Bob, Mary, Serena};
B := {Jim, Mary, John, Bob};
</lang>
 
Now compute the symmetric difference with the '''symmdiff''' command:
<lang Maple>
symmdiff(A, B);
</lang>
{{out}}
{Jim, Serena}
 
=={{header|Mathematica}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.