void Queue push_back int if end max_size end if size max_size std cout

 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
29
30
31
32
void Queue::push_back(int e) {
if(end == max_size) {
end = 0;
if(size>=max_size) std::cout<<"Queue overflow"<<std::endl;
else {
size ++;
queue[end] = e;
end++;
}
}
else {
if(size>=max_size) std::cout<<"Queue overflow"<<std::endl;
else {
size ++;
queue[end] = e;
end++;
}
}
}
void Queue::push_back(int e) {
if(end == max_size) end = 0;
if(size>=max_size) std::cout<<"Queue overflow"<<std::endl;
else {
size ++;
queue[end] = e;
end++;
}
}