[Tutor] Linked Lists

Tim Johnson tim at johnsons-web.com
Tue Aug 26 18:57:06 EDT 2003


> > If all you need simple singly-linked-list functionality for a project you're
> 
> I don't need it, I want it. I am trying to learn.
 
  I think that the productivity of python has to do with the
  fact that it 'manages' some of these issues.
  
  Python is written in C, and it is in looking a C code that
  you can learn about linked lists.

  Thomas Niemann has a nice site at
  http://www.planetoid.org/technical/sort_cookbook/

  and I believe that his Red-Black Trees implementation
  may have been used (at least indirectly) to influence
  some python add-ons.

  Regardless, if you look at his section on Skip Lists,
  you will see some information on single-linked lists,
  it's really a well-laid-out tutorial.

  There is lots of reference to double linked lists on
  the internet 
   I briefly scanned this one at:
   http://www.geocities.com/SiliconValley/Lakes/7504/old_stuff/Dlist.html

   thoroughly documented but I didn't run the code :-)
   tj

> 
> > >>> dir(list)
> > ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
> > '__delslice__', '__doc__', '__eq__', '__ge__', '__getattribute__',
> > '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__',
> > '__init__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__',
> > '__reduce__', '__repr__', '__rmul__', '__setattr__', '__setitem__',
> > '__setslice__', '__str__', 'append', 'count', 'extend', 'index', 'insert',
> > 'pop', 'remove', 'reverse', 'sort']
> 
> Umm I know. Maybe I should look at the implementation. There is this
> linked list project at sf, that I forgot the url of, but it's too obtuse
> for me.
> 
> > Now if it were a doubly-linked list, I think that would be another
> > matter....
> 
> Ok, how would you do a doubly-linked list?
> 
> Thanks,
> sukrit
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Tim Johnson <tim at johnsons-web.com>
      http://www.alaska-internet-solutions.com
      http://www.johnsons-web.com



More information about the Tutor mailing list