Create Implement Class Circular Doubly Linked List Public Methods Prepend Append Printcurr Q37040618

Create and implement a class for a Circular doubly-linked listthat has the public methods of prepend, append, print_current,go_next, go_prev, go_first, go_last, skip.

Each node holds the data of two strings.

No data members can be added to the class (i.e last/tail)

C++

Header file to work from:

#ifndef CDLL_H_
#define CDLL_H_

#include <fstream>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>

class CDLLNode {
private:
// these will contain the timestamp and content of the tweet asstrings
std::string time;
std::string tweet;

// these are pointers to the next and previous nodes in theCDLL
CDLLNode *next;
CDLLNode *prev;

public:
CDLLNode(const char *ti, const char *tw);
~CDLLNode();

friend class CDLL;
};

class CDLL {
private:
// pointer to the head/starting node in the CDLL
CDLLNode *head;
//points to last node

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.