diff lists

Michael Hudson mwh21 at cam.ac.uk
Thu Mar 29 17:57:49 EST 2001


Oliver Vecernik <vecernik at aon.at> writes:

> Hi,
> 
> I've got following two lists:
> 
> ['a', 'b', 'c', 'd', 'e', 'f']
> ['e', 'c', 'f']
> 
> I'd like to have the result:
> 
> ['a', 'b', 'd']
> 
> The list need not to be ordered. ['d', 'a', 'b'] will also be ok. What
> is the most effective way to achive that result?

Tangentially, does anyone know of any good algorithms for "edit
distance" between two sequences?  E.g. if I have 

"abcdef"

and want to get to

"abQUACKcde"

I want to get the answer back "insert 'QUACK' at position 3 and delete
a character at position 11".

"Good" means "pretty quick", here.

Cheers,
M.

-- 
  If your telephone company installs a system in the woods with no
  one around to see them, do they still get it wrong?
                                 -- Robert Moir, alt.sysadmin.recovery



More information about the Python-list mailing list