Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Symmetric-difference/Tcl/symmetric-difference.tcl
Normal file
15
Task/Symmetric-difference/Tcl/symmetric-difference.tcl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package require struct::set
|
||||
|
||||
set A {John Bob Mary Serena}
|
||||
set B {Jim Mary John Bob}
|
||||
|
||||
set AnotB [struct::set difference $A $B]
|
||||
set BnotA [struct::set difference $B $A]
|
||||
set SymDiff [struct::set union $AnotB $BnotA]
|
||||
|
||||
puts "A\\B = $AnotB"
|
||||
puts "B\\A = $BnotA"
|
||||
puts "A\u2296B = $SymDiff"
|
||||
|
||||
# Of course, the library already has this operation directly...
|
||||
puts "Direct Check: [struct::set symdiff $A $B]"
|
||||
Loading…
Add table
Add a link
Reference in a new issue