C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct data{
char name[100];
char type[100];
int priority;
struct data *next, *prev;
}*head, *tail, *curr;
int getPriority(char type[100]){
if(strcmp(type, "Platinum")==0) return 1;
else if(strcmp(type, "Gold")==0) return 2;
else return 3;
}
void view(){
curr=head;
while(curr!=NULL){
printf("%s %s \n", curr->name, curr->type);
curr = curr->next;
}
}
void push(char name[100], char type[100]){
struct data *newNode=(struct data*)malloc(sizeof(struct data));
strcpy(newNode->name, name);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run