Efficient Find and Replace

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Fri Jan 27 19:39:25 EST 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