replyPlease read my description carefully and try it yourself several times. Don't jump to conclusions so quickly. At first I thought the teacher had made a mistake. After careful consideration later, I found that it was correct. It just depends on how you understand it.
The queue mentioned on the Internet, the so-called "first in, first out", refers to the elements at the front of the array that come out of the queue first. There is no
Regarding the stack and queue modes, I personally think that the following explanation is reasonable: Stack operation (first in, last out mode: refers to the newly pushed data on the stack. When it is popped out of the stack, it is in the order in which it was originally pushed into the stack. In order, the data is pushed into the stack first and then popped out. In fact, it is popped out from the last data in the order after being pushed into the stack) ##%2
You may have mistaken the stack and the queue. The stack is last in, first out. The queue is first in, first out.
Regarding the stack and queue modes, I personally think that the following explanation is reasonable:
Stack operation (first in, last out mode: refers to the newly pushed data on the stack. When it is popped out of the stack, it is in the order in which it was originally pushed into the stack. In order, the data is pushed into the stack first and then popped out. In fact, it is popped out from the last data in the order after being pushed into the stack) ##%2