Language: C++

#include<iostream>
using namespace std;

class Node{
private:
  Node* next;
  Node* prev;
  int data;
public:
  Node(){
    next=0;
    prev=0;
    data=0;
  }
  Node(Node* n_next,Node* n_prev,int n_data){
    next=n_next;
    prev=n_prev;
    data=n_data;
  }
  void set_next(Node* next){
    this->next=next;
  }
  void set_prev(Node* prev){
    this->prev=prev;
  }
  void set_data(int data){
    this->data=data;
  }
  Node* get_next(){
    return next;
  }
  Node* get_prev(){
    return prev;
  }
  int get_data(){
    return data;
  }
};

class linkedList{
private:
  Node head;
  Node tail;
public:
  linkedList(){
    head.set_next(&tail);
    tail.set_prev(&head);
  }
  void insert(int x){
    Node* tmp=new Node(head.get_next(),&head,x);
    head.get_next()->set_prev(tmp);
    head.set_next(tmp);
  }
  void delete(int key){
    Node* search=head.get_next();
    tail.set_data(key);
    while(search->get_data()!=key){
      search=search->get_next();
    }
    if(search!=&tail){
      search->get_prev()->set_next(search->get_next());
      search->get_next()->set_prev(search->get_prev());
      delete search;
    }
  }
  void deleteFirst(){
    Node* tmp=head.get_next();
    head.set_next(head.get_next()->get_next());
    head.get_next()->set_prev(&head);
    delete tmp;
  }
  void deleteLast(){
    Node* tmp=tail.get_prev();
    tail.set_prev(tail.get_prev()->get_prev());
    tail.get_prev()->set_next(&tail);
    delete tmp;
  }
  void print(){
    Node* tmp=head.get_next();
    for(Node* i=head.get_next();i!=&tail;i=i->get_next()){
      cout<<i->get_data<<' '
    }
  }
};

int main(){
  LinkedList l;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    char a[15];
    if(a[0]=='i'){
      int key;
      cin>>key;
      l.insert(key)
    }
    if(a[6]==NULL){
      int x;
      cin>>x;
      l.delete(x);
    }
    if(a[6]=='F'){
      l.deleteFirst();
    }
    if(a[6]=='L'){
      l.deleteLast();
    }
  }
  l.print();
  return 0;
}



Compiler output:
a.cc:54:8: error: expected unqualified-id before 'delete'
   54 |   void delete(int key){
      |        ^~~~~~
a.cc: In member function 'void linkedList::print()':
a.cc:81:11: error: invalid use of non-static member function 'int Node::get_data()'
   81 |       cout<<i->get_data<<' '
      |       ~~~~^~~~~~~~~~~~~
a.cc:35:7: note: declared here
   35 |   int get_data(){
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:87:3: error: 'LinkedList' was not declared in this scope; did you mean 'linkedList'?
   87 |   LinkedList l;
      |   ^~~~~~~~~~
      |   linkedList
a.cc:95:7: error: 'l' was not declared in this scope
   95 |       l.insert(key)
      |       ^
a.cc:97:14: warning: NULL used in arithmetic [-Wpointer-arith]
   97 |     if(a[6]==NULL){
      |              ^~~~
a.cc:100:7: error: 'l' was not declared in this scope
  100 |       l.delete(x);
      |       ^
a.cc:100:9: error: expected unqualified-id before 'delete'
  100 |       l.delete(x);
      |         ^~~~~~
a.cc:103:7: error: 'l' was not declared in this scope
  103 |       l.deleteFirst();
      |       ^
a.cc:106:7: error: 'l' was not declared in this scope
  106 |       l.deleteLast();
      |       ^
a.cc:109:3: error: 'l' was not declared in this scope
  109 |   l.print();
      |   ^