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

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();

};

Step by Step Solution

3.56 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution Code include include using namespace std struct node int value node next class list private ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!