Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Trying to do this in C++:

Write a list class to implement a doubly linked list. The list should accommodate integers and pointers. You may add other types as 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 memory when inserting and the delete instruction to return the memory when removing.

Make the list into a class where the actual list is private and the member functions are public. Prove your program correctness by applying several test cases. Its up to you to decide what test cases will provide sufficient confidence your program works correctly. The output should have several test cases.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions

Question

6 Transfer tasks gently challenge the risk-averse. Discuss.

Answered: 1 week ago