TheAlgorithms-C/Data Structures/stack
Christian Bender 5ebfcf4148
simple modular and generic stack
See the README.md
2017-12-08 18:00:49 +01:00
..
main.c simple modular and generic stack 2017-12-08 18:00:49 +01:00
README.md simple modular and generic stack 2017-12-08 18:00:49 +01:00
stack.c simple modular and generic stack 2017-12-08 18:00:49 +01:00
stack.h simple modular and generic stack 2017-12-08 18:00:49 +01:00

Simple generic Stack

This is a modular generic stack data-structure. The stack is self growing.

Content

  • stack-Header file for import.
  • stack.c implementation of the stack
  • main.c framework program for testing.

You need to only import the stack.h

Public interface

void initStack();

Initializes the stack with a capacity of 10 elements.

void push(void * object);

pushs the argument onto the stack

void * pop();

pop: pops the top element of the stack from the stack.

assumes: stack not empty.

int size();

gets the number of elements of the stack.

int isEmpty();

returns 1 if stack is empty otherwise 0.