Menu

Trying C Write List Class Implement Doubly Linked List List Accommodate Integers Pointers Q43891649

Trying to do this in C++:

Write a list class to implement a doubly linked list. The listshould accommodate integers and pointers. You may add other typesas you need them.

Include member functions for the following:

void      insert_front(int data );

void      insert_front(void *data );

void      insert_rear(int data );

void      insert_rear(void *data );

int       remove_front_i( );

void *    remove_front_p( );

int       remove_rear_i( );

void *    remove_rear_p( );

int       empty( );

Use dynamic memory. Use the “new” instruction to allocate memorywhen inserting and the delete instruction to return the memory whenremoving.

Make the list into a class where the actual list is private andthe member functions are public. Prove your program correctness byapplying several test cases. It’s up to you to decide what testcases will provide sufficient confidence your program workscorrectly. The output should have several test cases.

Expert Answer


Answer to Trying to do this in C++: Write a list class to implement a doubly linked list. The list should accommodate integers and…

OR