Of the following data structures, which has a Last in First Out ordering? In other words, the one that came in last will be the first to be popped.
[ ] Queue [X] Stack
[ ] Vector [ ] Array List
Explanation: Correct answer is Stack. It is a well-known abstract data type (ADT) in computer science for last-in-first-out behavior. You can read more about it here. On the other hand Queue is an ADT which depicts first-in-first-out behavior. Vector and Array List both are a kind of arrays which can grow dynamically in size. Both vector and arrays support random seeking in constant amount of time (O(1)).