Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 What is a Circular Linked List? l A circular linked list is a list in which every node has a successor; the “last” element is succeeded by the “first”

Similar presentations


Presentation on theme: "1 What is a Circular Linked List? l A circular linked list is a list in which every node has a successor; the “last” element is succeeded by the “first”"— Presentation transcript:

1 1 What is a Circular Linked List? l A circular linked list is a list in which every node has a successor; the “last” element is succeeded by the “first” element. ‘B’ ‘C’ ‘L’ ‘T’ ‘V’ ‘Y’ listData

2 2 ‘A’ ‘C’ ‘F’ ‘T’ ‘Z’ What is a Doubly Linked List? listData l A doubly linked list is a list in which each node is linked to both its successor and its predecessor.

3 3 Each node contains two pointers class NodeType { public: ItemType info; // Data member NodeType* back; // Pointer to predecessor NodeType* next; // Pointer to successor };. back. info. next 3000 ‘A’ NULL

4 4 What are Header and Trailer Nodes? listData INT_MIN 5 8 13 INT_MAX l A Header Node is a node at the beginning of a list that contains a key value smaller than any possible key. l A Trailer Node is a node at the end of a list that contains a key larger than any possible key. l Both header and trailer are placeholding nodes used to simplify list processing.


Download ppt "1 What is a Circular Linked List? l A circular linked list is a list in which every node has a successor; the “last” element is succeeded by the “first”"

Similar presentations


Ads by Google