Introduction To Linked Lists
Introduction To Linked Lists
Linked lists let you insert elements at the beginning and end of
the list.
Let's know more about them and how they are different from each
other.
Singly Linked List
The real life application where the circular linked list is used is
our Personal Computers, where multiple applications are
running. All the running applications are kept in a circular linked
list and the OS gives a fixed time slot to all for running. The
Operating System keeps on iterating over the linked list until all
the applications are completed.
class Node {
public:
int data;
node* next;
node() {
data = 0;
next = NULL;
}
node(int x) {
data = x;
next = NULL;
Copy
Circular Linked List class will be almost same as the Linked List class
that we studied in the previous lesson, with a few difference in the
implementation of class methods.
class CircularLinkedList {
public:
node *head;
int isEmpty();
CircularLinkedList() {
head = NULL;