User Tools

Site Tools


haas:fall2011:data:projects:stacklib

Stack Library implementation

Linked Lists provide a foundation for dynamic structures. Further exploring Data Structures, we find that particular manipulations of these structures enable interesting possibilities for computing. Stacks are one such iteration of these Data Structures we are exploring this semester.

An excellent exploration with Stacks would be to extend your Linked List Library with Stack Functionality (or to create a new Stack library that depends on the Linked List library).

To create a Stack library, you may want to have the following functions:

  • create: generate a new stack
  • push: add a new node to the top of the stack
  • pop: remove the node from the top of the stack and return it
  • peek: retrieve the node from the top of the stack but do not remove it
  • isEmpty: is the stack in an empty condition?
  • delete: delete and de-allocate the stack
  • copy: duplicate the existing stack

A stack can be relatively infinite (so long as available resources are present for allocation) or fixed in size.

Your stack implementation should be able to handle/recognize the following situations:

  • unlimited stack size
  • fixed stack size
  • stack overflow
  • stack underflow

Implementing this functionality into a library will enable you to utilize it in additional projects.

haas/fall2011/data/projects/stacklib.txt · Last modified: 2011/08/22 16:15 by 127.0.0.1