common data structures

max(01)* max at fisso.casa
Sat Jul 31 17:06:01 EDT 2004


hi!

i am reading "how to think like a computer scientist - learning with 
python"... it semms like a good tutorial, but it shows a different 
language heritage... in particular, in the chapter about linked lists.

the question is: why bothering building a linked list class when you 
have a native list type in the first place? the same applies about 
trees, which can naturally be encoded like lists, e.g.:


       1
      / \
     2   3           --->     [1, [2, [4, 5]], 3] maybe...
    / \
   4   5

is it a teaching contrived example, a matter of performance or what else?

bye

max



More information about the Python-list mailing list