Language: C

#include<stdio.h>
#include<stdlib.h>

 struct Node{
           struct Node *prev;
           struct Node *next;
           int key;
           };

 typedef struct Node *Nodepointer;

 Nodepointer nil;

 void init(){
          nil=malloc(sizeof(struct Node));

          nil->prev=nil;
          nil->next=nil;
          }

 void printlist(){
          Nodepointer ser=nil->next;
          int isf=1;

          while(1){
                 if(ser==nil)break;
                 if(isf==0)printf(" ");
                 printf("%d",ser->key);
                 ser=ser->next;
                 isf=0;
                 }
          printf("\n");
          }


 void insert(int key){
          Nodepointer x=malloc(sizeof(struct Node));
          x->key=key;

          nil->next->prev=x;
          x->next=nil->next;
          nil->next=x;
          x->prev=nil;
          }

 Nodepointer serch(int key){
          Nodepointer ser=nil->next;
          while(ser != nil && ser->key != key){
                       ser=ser->next;
                       }
          return ser;
          }
          

 void delete(Nodepointer x){
          if(x==nil)return;
          x->prev->next=x->next;
          x->next->prev=x->prev;
          free(x);
          }

 void deletefirst(){
          delete(nil->next);
          }

 int deletelast(){
          delete(nil->prev);
          }

 int deletekey(int key){
          delete(serch(key));
          }

 int main(){
       int i,n,k;
       char com[20];
       init();
       scanf("%d",&n);
       for(i=0;i<n;i++){
                 scanf("%s %d",&com,&k);
                 
                 if(com[6]=='t'){insert(k);}
                 else if(com[6]=='e'){deletekey(k);}
                               if(strlen(com)>6){  
                                     if(com[6]=='F'){deletefirst();}
                                     else if(com[6]=='L'){deletelast();}
                                     }
                               }else{delete(k);}
                }
       printlist();
       return 0;
       }







Compiler output:
main.c: In function 'main':
main.c:84:35: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   84 |                                if(strlen(com)>6){
      |                                   ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
    2 | #include<stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:84:35: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   84 |                                if(strlen(com)>6){
      |                                   ^~~~~~
main.c:84:35: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:88:33: error: 'else' without a previous 'if'
   88 |                                }else{delete(k);}
      |                                 ^~~~
main.c:88:45: error: passing argument 1 of 'delete' makes pointer from integer without a cast [-Wint-conversion]
   88 |                                }else{delete(k);}
      |                                             ^
      |                                             |
      |                                             int
main.c:55:26: note: expected 'Nodepointer' {aka 'struct Node *'} but argument is of type 'int'
   55 |  void delete(Nodepointer x){
      |              ~~~~~~~~~~~~^
main.c: At top level:
main.c:90:8: warning: data definition has no type or storage class
   90 |        printlist();
      |        ^~~~~~~~~
main.c:90:8: error: type defaults to 'int' in declaration of 'printlist' [-Wimplicit-int]
main.c:90:8: error: conflicting types for 'printlist'; have 'int()'
main.c:21:7: note: previous definition of 'printlist' with type 'void()'
   21 |  void printlist(){
      |       ^~~~~~~~~
main.c:91:8: error: expected identifier or '(' before 'return'
   91 |        return 0;
      |        ^~~~~~
main.c:92:8: error: expected identifier or '(' before '}' token
   92 |        }
      |        ^