Efficient Find and Replace

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sat Jan 28 01:39:25 CET 2006


>But how is L[x] = Y an O(1) operation. Given x finding L[x] would require to traverse x nodes in the list.

Python list is a deceptive name, because they are 1D arrays of
pointers. Maybe they are called lists because array(...) is shorter
than list(...).

Bye,
bearophile




More information about the Python-list mailing list