MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

A SubListQ function?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28546] A SubListQ function?
  • From: AGUIRRE ESTIBALEZ Julian <mtpagesj at lg.ehu.es>
  • Date: Wed, 25 Apr 2001 19:21:53 -0400 (EDT)
  • Organization: Universidad del Pais Vasco/Euskal Herriko Unibertsitatea
  • Sender: owner-wri-mathgroup at wolfram.com

Given two lists a and b, how can I find if a is contained in b? I have
tried

	Complement[a, b] == {}

	Intersection[a, b] == a

	And@@(MemberQ[#,b]&/@a)

They work, but are not very efficient. Is there a better way?

Thanks in advance,

Julian Aguirre
Universidad del Pais Vasco



  • Prev by Date: nxn matrix into point coordinate
  • Next by Date: Mathematica 3.0 and AxesLabel
  • Previous by thread: Re: nxn matrix into point coordinate
  • Next by thread: Re: A SubListQ function?