Добавь в эту программу подпрограмму для вычисления разности двух списков: #include <iostream>
#include <string>
using namespace std;

class Node //элемент списка
{
public:
    int data;
    Node* prev, * next;
public:
    Node(int data)
    {
        this->data = data;
        this->prev = this->next = NULL;
    }
};

class LinkedList //список
{
public:
    Node* head, * tail;

public:
    LinkedList() //конструктор (создаёт пустой список)
    {
        head = tail = NULL;
    }

    void freeMemory() //освобождает память
    {
        if (head == NULL)
            return;

        Node* current = head;
        Node* nextNode;

        do
        {
            nextNode = current->next;
            delete current;
            current = nextNode;
        } while (current != head);

        head = tail = NULL;
    }

    void addSorted(int data)
    {
        Node* newNode = new Node(data);

        if (head == NULL) // если список пустой
        {
            head = tail = newNode;
            newNode->next = newNode->prev = newNode;
        }
        else if (data < head->data) // если новый элемент меньше головы списка
        {
            newNode->next = head;
            newNode->prev = tail;
            tail->next = newNode;
            head->prev = newNode;
            head = newNode;
        }
        else if (data > tail->data) // если новый элемент больше хвоста списка
        {
            newNode->next = head;
            newNode->prev = tail;
            tail->next = newNode;
            head->prev = newNode;
            tail = newNode;
        }
        else // если новый элемент располагается где-то в середине списка
        {
            Node* current = head->next;

            while (current != head && current->data < data)
            {
                current = current->next;
            }

            newNode->next = current;
            newNode->prev = current->prev;
            current->prev->next = newNode;
            current->prev = newNode;
        }
    }

    void removeBefore(int data)
    {
        if (head == NULL)
            return;

        Node* current = head->next;

        while (current != head)
        {
            if (current->data == data)
            {
                Node* nodeToRemove = current->prev;
                nodeToRemove->prev->next = current;
                current->prev = nodeToRemove->prev;
                delete nodeToRemove;
            }

            current = current->next;
        }

        if (head->data == data)
        {
            Node* nodeToRemove = tail;
            nodeToRemove->prev->next = head;
            head->prev = nodeToRemove->prev;
            tail = nodeToRemove->prev;
            delete nodeToRemove;
        }
    }

    Node* search(int data)
    {
        if (head == NULL)
            return NULL;

        Node* current = head;

        do
        {
            if (current->data == data)
                return current;

            current = current->next;
        } while (current != head);

        return NULL;
    }

    void print()
    {
        if (head == NULL)
            return;

        Node* current = head;

        do
        {
            cout << current->data << " ";
            current = current->next;
        } while (current != head);

        cout << endl;
    }
};

int main()
{

}