Question: PROGRAMMING LANGUAGE: C++ SUBJECT: DATA STRUCTURES AND ALGORTIHMS; NOTE: The question needs to be done keeping in view the concept of dummy head node in
PROGRAMMING LANGUAGE: C++
SUBJECT: DATA STRUCTURES AND ALGORTIHMS;
NOTE:
The question needs to be done keeping in view the concept of dummy head node in linked list.
Moreover, the question needs to be implemented using separate headers and cpp files .
The header files in this case will be
node.h
HList.h
The cpp files in this case will be
node.cpp
HList.cpp
driver.cpp
QUESTION:
Implement the (class) Linked List with Dummy head node to make 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();
bool emptyList(); // Checks if the list is empty or not
void insert_after(int oldV, int newV); //Inserts a new node with value 'newV' after node with value 'oldV'in the list
void insert_begin(int value); // Inserts a new node at the start of the list
void insert_end(int value); // Inserts a new node at the end of the list
void delete_Node(int val); // Deletes a node of value 'val' from the list
void delete_begin(); // Deletes a node from the beginning of the list
void delete_end(); // Deletes a node from the end of the list
void traverse(); // Displays the values stored in the list
};
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
