TheAlgorithms-C/data_structures/stack
2020-01-09 10:27:32 +01:00
..
stack_linked_list Fix filenames for DIRECTORY.md 2020-01-09 10:27:32 +01:00
main.c refactoring 2019-02-14 15:51:36 +01:00
parenthesis.c simplefy 2019-02-14 18:45:22 +01:00
README.md stack implementation by linkedlist 2019-07-01 18:06:21 -07:00
stack.c Update stack.c 2019-07-12 13:16:51 +08:00
stack.h Refactor 2018-10-08 21:18:35 +05:30

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.
  • stack_linkedlist: Another stack implementation by linkedlist

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.