Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!fshvmfk1.vnet.ibm.com!raghu From: raghu@fshvmfk1.vnet.ibm.com Newsgroups: comp.theory Subject: Re: Numbers .... Message-ID: <9105201825.AA23891@ucbvax.Berkeley.EDU> Date: 20 May 91 18:21:47 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 26 >From: sm2@sequent.cc.hull.ac.uk (Simon Marshall) >Message-ID: <15996.9105201547@seq.hull.ac.uk> >Date: 20 May 91 15:47:07 GMT > > Hi, does anybody know of an efficient algorithm to iteratively > produce all numbers consisting of x digits where each digit is used > at most once? ie. 58912, 01246 are valid; 58918, 01046 are not. > Many thanks. Simon. >_______________________________________________________________________________ >Simon Marshall, Dept. of Computer Science, University of Hull, Hull HU6 7RX, UK > "``La la la la la la la la la'' means I love you." > EMAIL: S.Marshall@Hull.ac.uk UUCP: ..!ukc!hu-cs!sm > Telephone: +44 482 465951 (office) Fax: +44 482 466666 A straight forward method is to generate all permutations for for each x-subset of the set {0,1,2,3,4,5,6,7,8,9}. There are efficient algorithms to generate subsets and permutations. Raghu V. Hudli IBM Corp. ==================================================================== Disclaimer: The opinions are my own and do not express the opinions of my employer