Can double-linked lists be implemented in python?

Aahz aahz at pythoncraft.com
Wed Apr 2 11:40:49 EST 2003


In article <3E8AFFB7.9516A49F at engcorp.com>,
Peter Hansen  <peter at engcorp.com> wrote:
>Robin Munn wrote:
>> sdieselil <sdieselil at yahoo.com> wrote:
>>>
>>> How can I implement double-linked lists and other complex tree-like
>>> structures in Python?
>> 
>> Do you *need* doubly-linked lists? Is there something that Python's
>> builtin list type can't do for you? Consider whether it's worth taking
>> the time to code up a data structure, with all the attendant edge cases,
>> when you've already got such nice useful builtin types...
>
>I can think of at least one example where one would *need* doubly-linked
>lists... a homework assignment.  ;-)

You have a nasty, paranoid mind.  I like that.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

This is Python.  We don't care much about theory, except where it intersects 
with useful practice.  --Aahz, c.l.py, 2/4/2002




More information about the Python-list mailing list