Re: [SLUG] Data structures

From: Jason Copenhaver (jcopenha@typedef.org)
Date: Tue Nov 12 2002 - 07:34:35 EST


Here's an example of a stack.. Any time you need to backtrack.. such as
you are going through a maze and you come to a point where there is a left
and a right turn... you take the right turn and push the left turn on the
stack.. once you find out the right turn is a dead end you can pop the
left turn off the stack and through away the dead end branch of the maze..

Jason

On Mon, 11 Nov 2002, Russell Hires wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> This is my problem that I come across for most sites:
>
> STACK
> "Definition: A collection of items in which only the most recently added item
> may be removed. The latest added item is at the top. Basic operations are
> push and pop. Also known as "last-in, first-out" or LIFO. "
>
> And my response: "Okay, great! What do you use it for?" or "So what?" This
> simply says what a stack is, but nothing more. What would you push or pop?
> And why would you? The only "data structure" that I get is the queue, and
> only in one context: mouse clicks. You point and click on several items in a
> sequence, and the queue processes them in the order that you clicked them.
>



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:36:13 EDT