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;
                 }
          pritf("\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(strlen(com)<=6){
                                 if(com[6]=='t'){insert(k);}
                                 else if(com[6]=='e'){deletekey(k);}
                 else if(com[7]=='F'){deletefirst();}
                 else if(com[7]=='L'){deletelast();}
                 }
       printlist();
       return 0:
       }







Compiler output:
main.c: In function 'printlist':
main.c:32:11: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   32 |           pritf("\n");
      |           ^~~~~
      |           printf
main.c: In function 'serch':
main.c:47:28: error: initialization of 'struct Node **' from incompatible pointer type 'struct Node *' [-Wincompatible-pointer-types]
   47 |           Nodepointer *ser=nil->next;
      |                            ^~~
main.c:48:21: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   48 |           while(ser != nil && ser->key != key){
      |                     ^~
main.c:48:34: error: 'ser' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   48 |           while(ser != nil && ser->key != key){
      |                                  ^~
      |                               (* )
main.c:49:31: error: 'ser' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   49 |                        ser=ser->next;
      |                               ^~
      |                            (* )
main.c:51:18: error: returning 'struct Node **' from a function with incompatible return type 'Nodepointer' {aka 'struct Node *'} [-Wincompatible-pointer-types]
   51 |           return ser;
      |                  ^~~
main.c: In function 'main':
main.c:81:21: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   81 |                  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:81:21: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   81 |                  if(strlen(com)<=6){
      |                     ^~~~~~
main.c:81:21: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:88:16: error: expected ';' before ':' token
   88 |        return 0:
      |                ^
      |                ;
main.c:89:8: error: expected declaration or statement at end of input
   89 |        }
      |        ^