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(){
          Nodepointer t = nil->next;
  if ( t == nil ) return;
  delete(t);
          }

 int deletelast(){
          Nodepointer t = nil->prev;
  if (t == nil) return;
  delete(t);
          }

 int deletekey(int key){
          Nodepointer t = search(key);
  if (t == nil) return;
  delete(t);
          }

 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[0]=='i'){insert(k);}
                 else if(com[0]=='d'){
                               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 'deletelast':
main.c:70:17: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   70 |   if (t == nil) return;
      |                 ^~~~~~
main.c:68:6: note: declared here
   68 |  int deletelast(){
      |      ^~~~~~~~~~
main.c: In function 'deletekey':
main.c:75:27: error: implicit declaration of function 'search'; did you mean 'serch'? [-Wimplicit-function-declaration]
   75 |           Nodepointer t = search(key);
      |                           ^~~~~~
      |                           serch
main.c:75:27: error: initialization of 'Nodepointer' {aka 'struct Node *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
main.c:76:17: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   76 |   if (t == nil) return;
      |                 ^~~~~~
main.c:74:6: note: declared here
   74 |  int deletekey(int key){
      |      ^~~~~~~~~
main.c: In function 'main':
main.c:90:35: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   90 |                                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:90:35: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   90 |                                if(strlen(com)>6){
      |                                   ^~~~~~
main.c:90:35: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:94:45: error: passing argument 1 of 'delete' makes pointer from integer without a cast [-Wint-conversion]
   94 |                                }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){
      |              ~~~~~~~~~~~~^