[Tutor] lists
Victor R. Cardona
vcardon@siue.edu
Tue, 23 Apr 2002 07:00:47 -0500
--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Apr 23, 2002 at 10:20:37AM -0700, Josh Gregorio wrote:
> What are linked lists and do you need them in Python?=20
A linked list is a data structure where each item in the list is
considered a node, and each node points to either the following node,
the preceeding node, or both. If it points to both the following node
and the preceeding node, then it is called a doubly linked list.
Linked lists are created using pointers in lanquages like C and C++.
Nodes are accessed in a linear fashion. However, the design makes the
removal or insertion of nodes very efficient.
You do not need linked lists in Python. In fact it would be very
difficult to create (if not impossible), because Python does not have
pointers. A standard list in Python should give you the functionality of
a linked list, and is much easier to create :-)
HTH,
Victor
--LZvS9be/3tNcYl/X
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE8xUzvZU/bSegbOhwRAvkIAJwK83HR5+2UlPkYv6n7DomhhhTUbQCggykm
ILV9A4UT0OeiSWOYUVbwSTs=
=lv3M
-----END PGP SIGNATURE-----
--LZvS9be/3tNcYl/X--