Sunday, 27 March 2011

FIFO and LIFO

PRINTER
FIFO - first in first out
Queues have to pointer's. A HP(head pointer) and a TP(tail pointer)
The document that is at the TP is the one that is about to be sent to the printer, as a document is taken from the TP it allows another document to be placed in the print queue, naturally in the HP.

STACK
LIFO - last in first out
Stacks have one pointer, it increments downwards and upwards as new documents/info is processed or added in.
A stack is used to record the returned addresses when a procedure is called.

No comments:

Post a Comment