else if strcmp ENQ scanf if QueueEmpty abc struct elem x0 x0 val x0 ma

 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
else if (strcmp(s, "ENQ") == 0)
{
scanf("%d", &x);
if (QueueEmpty(&abc))
{
struct elem x0;
x0.val = x;
x0.max = x;
Enqueue(&abc, x0);
}
else if (x > Max(&abc))
{
struct elem x1;
x1.val = x;
x1.max = x;
Enqueue(&abc, x1);
}
else
{
struct elem x2;
x2.val = x;
x2.max = Max(&abc);
Enqueue(&abc, x2);
}
}