lundi 30 septembre 2019

Create a doubly-linked list using the hierarchical structure with student struct with Big 5 notation

Homework Problem: Create a doubly-linked list using the hierarchical structure with student struct with Big 5 notation. Make sure to include the classes in the user defined class DLL: the big 5, MergeSort, additional helper functions to assist with MergeSort.

I'm trying to put together the big five, mergeSort, and additional helper function(s) to assist with MergeSort in a dynamically allocated doubly linked list with header. Also I'm using a student struct with variables of id, name, email, and gpa.

I've been trying to figure out which variables to use when implementing the code.

#ifndef MERGEDLL_H_
#define MERGEDLL_H_
#include <iostream>
using namespace std;

struct llist{
    int size;
    litemLL *first;
    litemLL *last;
};

struct litemLL{
    llist *origin;
    litemLL *next;
    litemLL *prev;
    record *data;
};

class record{
    int id;
    string name;
    string email;
    double gpa;
};

class mergeDLL{


public:
    mergeDLL(); // constructor
    ~mergeDLL(); // deconstructor
    mergeDLL(mergeDLL&& move); // move constructor
    mergeDLL& operator=(const mergeDLL& copy); // copy assignment
    mergeDLL& operator=(mergeDLL&& move); // move assignment

    friend ostream& operator<<(ostream& os,mergeDLL dll);
};

#endif

Aucun commentaire:

Enregistrer un commentaire