thanks for tries and bisect. this led me to the
wikipedia article
which was where i was looking to start. so, i think
the simplest
approach to search through a short list would
be a brute force
algorithm. like so :
get a letter and compare it to
every item in the list
if there is only one match:
we're done
if there is more than one:
get another letter
rinse and repeat
this is usually how i figure out how to code stuff.
anyway,
i am thinking there could be other brute-force
algorithms
that would accomplish the same
thing.
please correct me if i use any terminology
incorrectly.
so a trie would be a data structure for holding
your list in.
and bisect would be an algorithm for searching
through a list.
and determining which data structures and which
algorithms
to use would be depending on the nature of the list
and
what you wanted to do with it. have i got this
right?
|
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor