Implement the (class) Circular Linked List to create a list of integers. You need to provide the
Question:
Implement the (class) Circular Linked List to create a list of integers. You need to provide the implementation of the member functions as described in the following. class CList { private: Node *head; public: CList(); // Checks if the list is empty or not bool emptyList(); // Inserts a new node with value ‘value’ at position ‘pos’ in the list void insert_at(int pos, int value); // Inserts a new node at the start of the list void insert_begin(int value); // Inserts a new node at the end of the list void insert_end(int value); // Deletes a node from position ‘pos’ of the list void deleteNode(int pos); // Deletes a node from the beginning of the list void delete_begin(); // Deletes a node from the end of the list void delete_end(); // Displays the values stored in the list void traverse(); }; |
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch