Saturday, 8 April 2017

Circular Linked List

Circular linked lists do not have ends. While traversing the circular linked lists we should be careful; otherwise we will be traversing the list infinitely.



Note that unlike singly linked lists, there is no node with NULL pointer in a circularly linked list.



Usefulness of Circular Linked List :

For example, when several processes are using the same computer resource (CPU) for the same amount of time, we have to assure that no process accesses the resource before all other processes do (round robin algorithm).

Insertion Deletion and Printing content of CLL - See Example - 3.CircularLinkedList.cpp




No comments:

Post a Comment

Array

Program for Array Rotation 1st Method - Using temp array  - Time complexity - O(n), Space - O(d) See algo and code 2nd Method - rotate...