Language: C++

#include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;

//
class Node {
private:
	int key;
	Node *p_next = NULL;
	Node *p_prev = NULL;
public:
	Node(int k);
	void linkNext(Node n);
	void linkPrev(Node n);
	Node getNext();
	Node getPrev();
	bool hasKey(int k);
	void printKey();
};

Node::Node(int k)
{
	key = k;
}

void Node::linkNext(Node n)
{
	p_next = &n;
}

void Node::linkPrev(Node n)
{
	p_prev = &n;
}

Node Node::getNext()
{
	return *p_next;
}

Node Node::getPrev()
{
	return *p_prev;
}

bool Node::hasKey(int k)
{
	return key == k;
}

void Node::printKey()
{
	cout << key;
}

//
class LinkedList {
private:
	Node dummy;
	void linkNode(Node n1, Node n2);
public:
	LinkedList();
	void insertNode(int x);
	void deleteNode(int x);
	void deleteFirst();
	void deleteLast();
	void print();
};

LinkedList::LinkedList()
{
	Node n(-1);
	n.linkNext(n);
	n.linkPrev(n);
	dummy = n;
}

void LinkedList::linkNode(Node n1, Node n2)
{
	n1.linkNext(n2);
	n2.linkPrev(n1);
}

void LinkedList::insertNode(int x)
{
	Node n(x);
	linkNode(n, dummy.getNext());
	linkNode(dummy, n);
}

void LinkedList::deleteNode(int x)
{
	Node n = dummy.getNext();
	while (!n.hasKey(x)) {
		if (n.hasKey(-1)) return;
		n = n.getNext();
	}
	
	linkNode(n.getPrev(), n.getNext());
}

void LinkedList::deleteFirst()
{
	linkNode(dummy, dummy.getNext().getNext());
}

void LinkedList::deleteLast()
{
	linkNode(dummy.getPrev().getPrev(), dummy);
}

void LinkedList::print()
{
	Node n = dummy.getNext();
	if (n.hasKey(-1)) return;
	while (1) {
		n.printKey();
		n = n.getNext();
		if (n.hasKey(-1)){
			cout << endl;
			break;
		} else {
			cout << " ";
		}
	}
}

//
int main(void)
{	
	LinkedList list;
	
	int n;
	cin >> n;
	
	for (int i = 0; i < n; i++) {
		char command[12] = "\0";
		sin >> command;
		if (strcmp(command, "insert") == 0) {
			list.insertNode(cin);
		} else if (strcmp(command, "delete") == 0) {
			list.deleteNode(cin);
		} else if (strcmp(command, "deleteFirst") == 0) {
			list.deleteFirst();
		} else {
			list.deleteLast();
		}
	}

	list.print();
	
	return 0;
}

Compiler output:
a.cc: In constructor 'LinkedList::LinkedList()':
a.cc:71:24: error: no matching function for call to 'Node::Node()'
   71 | LinkedList::LinkedList()
      |                        ^
a.cc:22:1: note: candidate: 'Node::Node(int)'
   22 | Node::Node(int k)
      | ^~~~
a.cc:22:1: note:   candidate expects 1 argument, 0 provided
a.cc:7:7: note: candidate: 'constexpr Node::Node(const Node&)'
    7 | class Node {
      |       ^~~~
a.cc:7:7: note:   candidate expects 1 argument, 0 provided
a.cc:7:7: note: candidate: 'constexpr Node::Node(Node&&)'
a.cc:7:7: note:   candidate expects 1 argument, 0 provided
a.cc: In function 'int main()':
a.cc:139:17: error: 'sin' was not declared in this scope
  139 |                 sin >> command;
      |                 ^~~
a.cc:141:41: error: cannot convert 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
  141 |                         list.insertNode(cin);
      |                                         ^~~
      |                                         |
      |                                         std::istream {aka std::basic_istream<char>}
a.cc:85:33: note:   initializing argument 1 of 'void LinkedList::insertNode(int)'
   85 | void LinkedList::insertNode(int x)
      |                             ~~~~^
a.cc:143:41: error: cannot convert 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
  143 |                         list.deleteNode(cin);
      |                                         ^~~
      |                                         |
      |                                         std::istream {aka std::basic_istream<char>}
a.cc:92:33: note:   initializing argument 1 of 'void LinkedList::deleteNode(int)'
   92 | void LinkedList::deleteNode(int x)
      |                             ~~~~^