Language: C

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

struct node{

  int key;
  struct node *next;
  struct node *prev;
};
typedef struct node * NodePointer;

void insert(int);
void delete(NodePointer);
void deleteFirst(void);
void deleteLast(void);
NodePointer findkey(int);
 
NodePointer nil;

int main(){

  int i,in,n;
  char s[20];
  NodePointer x;

  nil=malloc(sizeof(struct node));
  nil->next=nil;
  nil->prev=nil;

  scanf("%d",&n);

  i=0;
  while(i!=n){

    memset(s,'\0',20);
    scanf("%s",s);
    i++;
      if(strcmp(s,"insert")==0){
	scanf("%d",&in);
	insert(in);
      }
      else if(strcmp(s,"delete")==0){
	scanf("%d",&in);
	x=findkey(in);
	if(x->next==nil) continue;
	else delete(x);
      }
      else if(strcmp(s,"deleteFirst")==0) {
	deleteFirst();
      }
      else if(strcmp(s,"deleteLast")==0){
	  deleteLast();
	}
  }
	
	
  for(x=nil->next;x->next!=nil;x=x->next) printf("%d ",x->key);
  
 printf("%d\n",x->key);


  return 0;
}

void insert(int x){

  NodePointer new;

  new=malloc(sizeof(struct node));

  new->key=x;
  new->next=nil->next;
  nil->next->prev=new;
  nil->next=new;
  new->prev=nil;

}

void delete(NodePointer delnode){

  delnode->prev->next=delnode->next;
  delnode->next->prev=delnode->prev;
  free(delnode);

}

NodePointer findkey(int x){

  NodePointer tmp;

  tmp=malloc(sizeof(struct node));

  tmp=nil->next;
  while(tmp->next!=nil && tmp->key!=x){
    tmp=tmp->next;
  }

  return tmp;
}

void deleteFirst(void){
  NodePointer delnode;
  delnode=nil->next;

  if(delnode->next==nil){
    nil->next=nil;
    nil->prev=nil;
    free(delnode);
  }
  else{
    nil->next=delnode->next;
    delnode->next->prev=delnode->prev;
    free(delnode);
  }
  #include<stdio.h>
#include<stdlib.h>
#include<string.h>

struct node{

  int key;
  struct node *next;
  struct node *prev;
};
typedef struct node * NodePointer;

void insert(int);
void delete(NodePointer);
void deleteFirst(void);
void deleteLast(void);
NodePointer findkey(int);
 
NodePointer nil;

int main(){

  int i,in,n;
  char s[20];
  NodePointer x;

  nil=malloc(sizeof(struct node));
  nil->next=nil;
  nil->prev=nil;

  scanf("%d",&n);

  i=0;
  while(i!=n){

    memset(s,'\0',20);
    scanf("%s",s);
    i++;
      if(strcmp(s,"insert")==0){
	scanf("%d",&in);
	insert(in);
      }
      else if(strcmp(s,"delete")==0){
	scanf("%d",&in);
	x=findkey(in);
	if(x->next==nil) continue;
	else delete(x);
      }
      else if(strcmp(s,"deleteFirst")==0) {
	deleteFirst();
      }
      else if(strcmp(s,"deleteLast")==0){
	  deleteLast();
	}
  }
	
	
  for(x=nil->next;x->next!=nil;x=x->next) printf("%d ",x->key);
  
 printf("%d\n",x->key);


  return 0;
}

void insert(int x){

  NodePointer new;

  new=malloc(sizeof(struct node));

  new->key=x;
  new->next=nil->next;
  nil->next->prev=new;
  nil->next=new;
  new->prev=nil;

}

void delete(NodePointer delnode){

  delnode->prev->next=delnode->next;
  delnode->next->prev=delnode->prev;
  free(delnode);

}

NodePointer findkey(int x){

  NodePointer tmp;

  tmp=malloc(sizeof(struct node));

  tmp=nil->next;
  while(tmp->next!=nil && tmp->key!=x){
    tmp=tmp->next;
  }

  return tmp;
}

void deleteFirst(void){
  NodePointer delnode;
  delnode=nil->next;

  if(delnode->next==nil){
    nil->next=nil;
    nil->prev=nil;
    free(delnode);
  }
  else{
    nil->next=delnode->next;
    delnode->next->prev=delnode->prev;
    free(delnode);
  }
  

}

void deleteLast(void){

  NodePointer delnode;

  for(delnode=nil->next;delnode->next!=nil;delnode=delnode->next);

  delnode->prev->next=nil;
  nil->prev=delnode->prev;

  free(delnode);
}


}

void deleteLast(void){

  NodePointer delnode;

  for(delnode=nil->next;delnode->next!=nil;delnode=delnode->next);

  delnode->prev->next=nil;
  nil->prev=delnode->prev;

  free(delnode);
}

Compiler output:
main.c: In function 'deleteFirst':
main.c:129:6: error: conflicting types for 'delete'; have 'void(struct node *)'
  129 | void delete(NodePointer);
      |      ^~~~~~
main.c:80:6: note: previous definition of 'delete' with type 'void(struct node *)'
   80 | void delete(NodePointer delnode){
      |      ^~~~~~
main.c:132:13: error: conflicting types for 'findkey'; have 'struct node *(int)'
  132 | NodePointer findkey(int);
      |             ^~~~~~~
main.c:88:13: note: previous definition of 'findkey' with type 'struct node *(int)'
   88 | NodePointer findkey(int x){
      |             ^~~~~~~
main.c:181:6: error: redefinition of 'insert'
  181 | void insert(int x){
      |      ^~~~~~
main.c:66:6: note: previous definition of 'insert' with type 'void(int)'
   66 | void insert(int x){
      |      ^~~~~~
main.c:195:6: error: static declaration of 'delete' follows non-static declaration
  195 | void delete(NodePointer delnode){
      |      ^~~~~~
main.c:129:6: note: previous declaration of 'delete' with type 'void(struct node *)'
  129 | void delete(NodePointer);
      |      ^~~~~~
main.c:203:13: error: static declaration of 'findkey' follows non-static declaration
  203 | NodePointer findkey(int x){
      |             ^~~~~~~
main.c:132:13: note: previous declaration of 'findkey' with type 'struct node *(int)'
  132 | NodePointer findkey(int);
      |             ^~~~~~~
main.c:217:6: error: redefinition of 'deleteFirst'
  217 | void deleteFirst(void){
      |      ^~~~~~~~~~~
main.c:102:6: note: previous definition of 'deleteFirst' with type 'void(void)'
  102 | void deleteFirst(void){
      |      ^~~~~~~~~~~
main.c:235:6: error: static declaration of 'deleteLast' follows non-static declaration
  235 | void deleteLast(void){
      |      ^~~~~~~~~~
main.c:131:6: note: previous declaration of 'deleteLast' with type 'void(void)'
  131 | void deleteLast(void);
      |      ^~~~~~~~~~