After reading the beginning, I was so scared that I quickly took a look at the comments. Sure enough, there was someone who had the same idea.
混入狼坑的哈士奇2017-07-05 15:09:33
My feeling is that the stack is "the data at the end of the array goes out, that is, last in, first out", while the queue is also "last in, first out" because the last added at the head is always at the beginning and the dequeue is deleted. It’s the beginning, so what’s deleted is what’s added last, so it’s last in, first out