How can I create a linked list in Python?

kernel1983 kernel1983 at gmail.com
Wed Jan 17 03:44:20 CET 2007


Every language has its own way to do the business!
Python has a more abstract data type as the common tools.
Just do things in pythonic way!

On 1月17日, 上午9时55分, Gabriel Genellina
<gagsl... at yahoo.com.ar> wrote:
> At Tuesday 16/1/2007 17:07, Dongsheng Ruan wrote:
>
> >Thanks for your kindly help.
> >I am new CS student taking datat structure and algorithms with AHO's book
> >with the same title.
>
> >The book is done in Pascal, which might be an outdated language.
>
> >However, my instructor probably wants us to understand the list ADT better
> >by not using the built in list in Python.Just use the same structure as the book. Instead of nil, use None;
> instead of new(P) where P:^Foo, use P=Foo(); records become classes
> without methods...
>
> Anyway, implementing linked lists, dictionaries, and other basic
> structures in a language like Pascal, or C -which doesn't have them
> natively- may be a good learning exercise. But doing that in Python
> is not a good idea. Of course, using Python in a second or third
> algorithms course *is* a good idea, because you can forget about
> these implementation details and concentrate on the algorithms.
>
> --
> Gabriel Genellina
> Softlab SRL
>
> __________________________________________________
> Preguntá. Respondé. Descubrí.
> Todo lo que querías saber, y lo que ni imaginabas,
> está en Yahoo! Respuestas (Beta).
> ¡Probalo ya!http://www.yahoo.com.ar/respuestas




More information about the Python-list mailing list