This C++ project demonstrates various operations on different types of linked lists, including Singly Linear, Singly Circular, Doubly Linear, and Doubly Circular Linked Lists. The project is structured using classes and templates for flexibility.
NodeG
Classnext
), and a pointer to the previous node (prev
).LinkedList
Class (Abstract Base Class)DoublyCL
ClassLinkedList
and implements a Doubly Circular Linked List.DoublyLL
ClassLinkedList
and implements a Doubly Linear Linked List.SinglyCL
ClassLinkedList
and implements a Singly Circular Linked List.SinglyLL
ClassLinkedList
and implements a Singly Linear Linked List.The main
function provides examples of using each type of linked list. It demonstrates creating instances, inserting elements, deleting elements, and displaying the contents of the linked lists.
int main()
{
// Examples of using Doubly Circular Linked List
DoublyCL<int> dcobj;
dcobj.InsertFirst(51);
dcobj.InsertFirst(21);
dcobj.InsertFirst(11);
dcobj.Display();
// ... (continue with various operations)
// Examples of using Singly Linear Linked List
SinglyLL<int> slobj;
slobj.InsertFirst(51);
slobj.InsertFirst(21);
slobj.InsertFirst(11);
slobj.Display();
// ... (continue with various operations)
return 0;
}
Feel free to contribute to this project by extending or improving the existing functionality of linked list operations. If you have ideas for additional features or optimizations, your contributions are welcome.
This project was created by Swaraj Mhatre.