Site hosted by Angelfire.com: Build your free website today!


STACK
The Lair Data Structures Main
Topics:

Stack

Queue

Linked Lists

Tree

More to Come!

EXAMPLES:

STACKS:

DEFINITION:

- A stack is one of the most commonly used data structures. In a stack, the last data to be stored is accessed first. This is know as LIFO which means Last-in first-out. Inserting data into the stack and deleting from the stack is done at one end which is referred to as the top. The process of inserting an element into a stack is known as push. The process of deleting an element from a stack is known as pop.

OPERATIONS:

  • POP - Removing an element from stack
  • PUSH - Inserting element into stack
  • EMPTY - Check to see if stack is empty
  • FULL - Check to see if stack is full

SOME STACK APPLICATIONS:

  • Evaluation arithmetic
  • Converting infix notations to postfix or prefix notations
  • Evaluating a postfix notation
  • Convert recursion function to non-recursive

WAYS TO IMPLEMENT STACKS:

  • Using an Array
  • Using Structure
  • Using Class
  • Using Linked Lists