DisjointQ

DisjointQ[list1,list2]

yields True if list1 and list2 do not share any common elements, and False otherwise.

Details and Options

  • DisjointQ works for expressions with heads other than List.
  • When applied to associations, DisjointQ compares their values.
  • DisjointQ[list1,list2,SameTesttest] applies test to each pair of elements in the listi to determine whether they should be considered the same.

Examples

Basic Examples  (1)

Test whether lists share no elements:

Wolfram Research (2014), DisjointQ, Wolfram Language function, https://reference.wolfram.com/language/ref/DisjointQ.html (updated 2022).

Text

Wolfram Research (2014), DisjointQ, Wolfram Language function, https://reference.wolfram.com/language/ref/DisjointQ.html (updated 2022).

CMS

Wolfram Language. 2014. "DisjointQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/DisjointQ.html.

APA

Wolfram Language. (2014). DisjointQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DisjointQ.html

BibTeX

@misc{reference.wolfram_2024_disjointq, author="Wolfram Research", title="{DisjointQ}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/DisjointQ.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_disjointq, organization={Wolfram Research}, title={DisjointQ}, year={2022}, url={https://reference.wolfram.com/language/ref/DisjointQ.html}, note=[Accessed: 21-November-2024 ]}