Implement the (class) Linked List with Dummy head node to create a list of integers. You need
Question:
Implement the (class) Linked List with Dummy head node to create a list of integers. You need to provide the implementation of the member functions as described in the following. class HList { private: Node * head; public: HList(); // Checks if the list is empty or not bool emptyList(); // Inserts a new node with value ‘newV’ after node with value ‘oldV’in the list void insert_after(int oldV, int newV); // 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(); }; |
Core Concepts Of Accounting Information Systems
ISBN: 9780470507025
11th Edition
Authors: Nancy A. Bagranoff, Mark G. Simkin, Carolyn Strand Norman