An introduction to circular linked lists, a data structure where nodes are connected to form a ring, extending the concept of singly linked lists. The list is finite, each node has a successor, and there is no null reference. An example of using circular linked lists for process scheduling and media playback, as well as an implementation using the node and intcllist classes.
Download Circular Linked Lists: A Circular Extension of Singly Linked Lists and more Study notes Data Structures and Algorithms in PDF only on Docsity!
Data Structures and Algorithms
LECTURE 06 – CIRCULAR LINKED LIST
In circular Linked List nodes are connected to form a ring
The list is finite and each node has a successor
There is no NULL reference in the list
class Node
public :
int Info;
Node* next;
Node( int el, Node *ptr = NULL)
Info = el;
next = ptr;
Many more operations can be included:
addToHead(int)
deleteFromHead()
addNode(int) -. -. class IntCLList { private : Node *tail; int Size; public : IntCLList() { tail = NULL; Size = 0; } ~IntCLList(); int isEmpty() { return (tail == NULL); } void addToTail( int ); int deleteNode( int ); void showList(); };