Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

what is the best language to do this in?

Name: Anonymous 2010-01-14 19:13

I have a set of data:
Sally has attribute A and attribute B
Bob has attribute D and attribute R
John has attribute S and attribute T
Melissa has attribute G and attribute M

etc.  There are over 300 names and 21 different attributes (let's call them A, B, ..., T, U) in varying combinations.

I want to pick out a set of 5 names with 2 attributes each that fit in a pattern of (for example) A,B,C,D,E,F,H,I,J,K

What's the best way to go about this?  I'm programming language neutral, though I do have some experience in bash, python and perl.  It would have to take input from a text file (either tab delimited or csv) and output which names to pick and what their attributes are.

Name: Anonymous 2010-01-14 19:19

Languages don't really matter for something like this as much as the data structure you hold the names in. It also depends how many *times* you want to do this. If you're doing it once, just search naively: it's the fastest you'll get. Otherwise, you're better off storing names that have a certain attribute together than storing the names as a hashmap to their attributes.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List