2 ms·
FIFO/LIFO etc. I have the impression it's just me, but I never remember which of those means what. Does "first out" mean the first/top-most element in the queu
by alpaca128 5y ago
FIFO/LIFO etc.
I have the impression it's just me, but I never remember which of those means what. Does "first out" mean the first/top-most element in the queue or the first one that was pushed in? No idea, I just can't help it but my brain refuses to memorise this detail and I have to look it up each time.
A variation like "top in, bottom out" would be much clearer imho because it doesn't have this ambiguity.
- jaredsohn 5y agoIt might be helpful to think of it as "the first one in is the first one out"; 'first' describes the order of adding/removing. Also, it may be helpful to remember that FIFO means you'll get data back in the original order while in LIFO they'll be reversed.
- compressedgas 5y agoI avoid these abbreviations just call them queue and stack.