Generic implementation of Data Structures in C++.
A singly linked list is a way to store a collection of elements. Like an array these can be character or integers. Each element in a singly linked list is stored in the form of a node. A node has two parts. A data part that stores the element and a next part that stores the link to the next node.
Check singlyLinkedList.h for it's implementaion and singlyLinkedListExample.cpp for how to use it.
Complie the above code of singlyLinkedListExample.cpp using :- g++ singlyLinkedListExample.cpp -o singlyLinkedListExample.exe
Stacks are a type of container which operate according to last in first out (LIFO) principle i.e. the last element that is added to the stack is the first one to be removed. Elements are always added to the front and removed from the front.
Check stack.h for it's implementaion and StackExample.cpp for how to use it.
Complie the above code of stackExample.cpp using :- g++ stackExample.cpp -o stackExample.exe
Queues are a type of container which operate according to first in first out (FIFO) principle i.e. the first element that is added to the queue is the first one to be removed. Elements are always added to the back and removed from the front.
Check queue.h for it's implementaion and queueExample.cpp for how to use it.
Complie the above code of queueExample.cpp using :- g++ queueExample.cpp -o queueExample.exe
NOTE :- Before compiling make sure that you have respective header file in your working folder.