- Generic Data type support.
- Auto garbage collection while poping out the data from stack.
- No size restriction due to implementation with the help of linked list.
- Better data structure management.
- push and pop operation with time complexity of O(1).
- Clone this project.
git clone https://github.com/namantam1/stack
cd stack
- Run the example file with make or command line.
make && ./example.out
# or
gcc stack.c example.c -o example.out && ./example.out
- To use this stack in another project import this libary as -
#include "stack/stack.h"
int main() {
int data = 10;
// create a new stack
stack q = create_stack(&data);
// do you stuff
// ...
// ...
// destroy the stack if not in use to free the memory.
destroy_stack(&q);
}
If you find any issue please don't hesitate to create an issue.
Any Contribution or suggestion are welcome.
This project is under MIT License.