[Tutor] When am I ever going to use this?

Michael P. Reilly arcege at gmail.com
Wed Aug 2 15:45:35 CEST 2006


On 8/1/06, Christopher Spears <cspears2002 at yahoo.com> wrote:
>
> I've been working through a tutorial:
> http://www.ibiblio.org/obp/thinkCSpy/index.htm.
> Lately, I have been learning about abstract data types
> (linked lists, stacks, queues, trees, etc.).  While I
> do enjoy the challenge of creating these objects, I am
> not sure what they are used for.
>

Queues and linked lists are also used extensively inside operating systems.
Process lists are a large collections of queues organized in multiple queues
implemented as linked lists and stored in one array.  File systems store
files by accessing data blocks through linked "blocks" (not quite the same
as your linked node structure) and access to the disks and the network are
through queues.  Trees are used less often, but still very useful.  The
directory structure (folders and files) on your disk are trees, the program
to search your email may use a tree.  Stacks are often used for network
protocols and program execution (every time you call a function, you are
pushing something onto a stack).

How about real life uses for these structures.  Queues are one of the most
natural structures from social life brought into computer science.  Insects,
banks, highways, birds, even the lunch line in grade school used queues.
Stacks are the next, with stacks of books, papers, etc.  Trees are used for
people's genealogies.  And you might used a linked list in a treasure hunt
or for footnotes and bibliographies.  Even post-it notes are a form of
mental linked list.

I hope this helps your understanding.
  -Arcege
-- 
There's so many different worlds,
So many different suns.
And we have just one world,
But we live in different ones.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060802/b9d27cd0/attachment.html 


More information about the Tutor mailing list