Arrays和list是随机读取的,很灵活。
但如果你想用先进先出,或者先进后出的顺序。就可以用queue 和 stack。
Because they help manage your data in more a particular way than arrays and lists.
Queue is first in, first out (FIFO)
Stack is last in, first out (LIFO)
Arrays and lists are random access. They are very flexible and also easily corruptible. IF you want to manage your data as FIFO or LIFO it’s best to use those, already implemented, collections.