Wolfram: List. Join, Union, Intersection, Difference

By Xah Lee. Date: . Last updated: .

Join Lists

Join

concatenate lists

Join[{1,2,3}, {a,b,c}]
(* {1, 2, 3, a, b, c} *)

List as Set, Union, Intersection, Complement

Union

union of sets

Union[{1,2,3}, {1,2,4}]
(* {1, 2, 3, 4} *)
Intersection

intersection of sets

Intersection[{1,2,3}, {1,2,4}]
(* {1, 2} *)
Complement

subtract a set from other sets

Complement[{1,2,3}, {1,2,4}]
(* {3} *)

Wolfram. List Operations, and Loop, Iteration, Recursion