Using the following UML diagram and class description, write a class named MyDLL which implements a pointer-based doubly linked list.
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlinesOrder Paper Now
- Node – a nested struct
- i – stores an integer
- next – the pointer that holds the memory address of the following node.
- prev – the pointer that holds the memory address of the preceding node.
- head – the pointer that holds the memory address of the head node (the first node in the list).
- tail – the pointer that holds the memory address of the tail node (the last node in the list).
- constructor – initializes head and tail to null.
- destructor – frees all memory used by the list.
- append – if there is enough memory, stores it’s argument in a new node and attaches that new node to the end of the list.
- remove – searches for it’s argument in the list. Removes the first node it finds that contains a value matching it’s argument.
- find – searches for it’s argument in the list. Returns true if it’s found, false otherwise.
- clear – frees all memory used by the list. Ensures head and tail are set back to null.
- print – prints the values stored in the list in order.
- reverse – prints the values stored in the list in reverse order.
- The class does not interact with the user in any way, so no cin or cout statements.
- All accessors should be marked const.
- struct Node is nested in the class and is private.
- Since the insert and append algorithms are incompatible, only implement the append algorithm.
- Save yourself some work by having the destructor call clear.
- There is no isFull or isEmpty method in the class.
- Place your class in it’s own header file named MyDLL.h.
- Submit only this file.
- Be sure to include preprocess guards( #ifndef, #define, #endif).