문제

What is the difference between the stack and the queue when it comes to data storage?

도움이 되었습니까?

해결책

A stack works like a tray of dirty dishes, the first one you put on the stack will be the last one out of the stack. The last one on the stack will be the first one popped off the stack (Last in first out).

The queue works in the same way a line at the supermarket works. The first one in a queue will be the first one out of the queue(First in first out).

다른 팁

Stack - first in first out.

Queue - first in last out

Various methods to implement

Does that answer your homework

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top