"Knacktus" <knack...@googlemail.com> wrote

I'm wondering what's the fastet datatype in python to lookup the last element in an ordered collection.

When in doubt timeit()

But I would expect a standard list to be prettyy fast isf you are
only concerned about accessing the last element [-1]

Also, the collections will be small (about 10-20 elements), but I will have huge amount (50000-100000) of those collections which need to be processed for certain tasks in my application.

Sounds like you should be more concerned about how you locate
the specific collection than about finding the last element in each...
What kind of container will the collections sit in?


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to