10 ms·
lifo: last in, first out (cafeteria food line) -- taking from front/top, adding to back/bottom -- enought shifts will push element out of array queue without ne
by sargstuff 3y ago
lifo: last in, first out (cafeteria food line) -- taking from front/top, adding to back/bottom -- enought shifts will push element out of array queue without need to 'unshift'
fifo : first in, first out (stack of plates) -- taking from front/top, adding to front/top. -- shift on "1"/push; unshift off "0"/pop. start with at least one shift/push. ideally equal number of unshifts/pops by end of task to clear the stack array.
- wrboyce 3y agoYou have these the wrong way around. LIFO is a stack, FIFO is a queue.