Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
MathProgramming
· 14y ago · 0 comments
Why would they simulate a linked list using tuples? It seems a bit contrived (or rather, not Pythonic) when lists are a built-in datatype.
Comments
[–]
TeMPOraL
14y ago
A quick way to emulate cons cells[1], which are good for explaining how linked lists work?
[1] -
http://en.wikipedia.org/wiki/Cons
[–]
pgbovine
14y ago
Yep, right on! I wanted to show off linked list recursion and render box-and-pointer diagrams like those seen in SICP.