From: Ken Bloom Date: 2007-01-10T13:10:11+09:00 Subject: Re: [QUIZ][SOLUTION] Word Blender (#108) On Wed, 10 Jan 2007 11:17:24 +0900, Daniel Finnie wrote: > Hi Ken, > > Ken Bloom wrote: >> #load dictionary >> matcher=Set.new >> allwords=Array.new > >> thiswordmatcher=Set.new > > I'm interested in why you used a set for matcher and an array for > allwords. Was this a kindof random decision (many of mine are!) or is > there something that allwords needed to be able to do and so is an array > or vice versa? allwords needs array indexing to pick a random word from the array. The sets, however, need duplicate removal and/or need include? to operate in O(1). --Ken -- Ken Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/