AI Horizon: Intelligence and Reason in Computers
Introduction Home Essays Resources Contact Info
Essays
  Basic CS
General AI
Chess AI
Go AI

Resources
  Source Code
AI Tips and Tricks
Books
Links

Other
  Code Journal
Site Updates

An Affiliate of Cprogramming.com
 

Stack Source Code
(Up to Resources : Source Code Repository : Lists)

This source file is an implementation of the Stack class. The class is implemented with templates.

For the templated class, the elements must have the operators >, =, and < defined.

This class has one new function:

const Elem &Peek(int Depth) const;

Given a whole number Depth, Peek() returns the Stack element which is Depth levels from the top. This stack element cannot be modified.

There is a default size limit of 500 elements for the stack, but this can be overridden in the constructor call. Read the source code for more information.

Download the Source: stack.h

All content is written and published by the people at or affiliated with AI Horizon <http://www.aihorizon.com/>.
Send any comments and suggestions to comments@aihorizon.com.

Please report any errors to webmaster@aihorizon.com.