Correct option is D
A queue typically follows the FIFO (First In First Out) principle, where the first element inserted is the first one to be removed. However, the term LILO (Last In Last Out) can also apply to certain variations of queue systems in specific contexts, such as double-ended queues (Deque). Hence, FIFO is the general rule for a basic queue, while LILO might apply to specialized implementations.
Important Key Points:
1. FIFO (First In First Out):
· The first element to be inserted is the first one to be removed.
· Standard queue follows this principle.
2. LIFO (Last In First Out): Not applicable to queues, but applicable to stack data structures, where the last element inserted is removed first.
3. LILO (Last In Last Out): In some cases, deque (double-ended queue) can function in LILO mode, where elements can be added and removed from both ends, thus making LIFO behavior possible at one end and FIFO at the other.