answersLogoWhite

0

FILO is an acronym of "first in last out". If we imagine a stack of plates, the first plate is at the bottom of the stack and is therefore the last to be removed from the stack. Thus FILO is used when referring to a stack. We use a stack when we wish to process elements in the reverse order they arrive, always processing the newest arrival first. Stacks are useful in backtracking algorithms and are a fundamental aspect of the call-and-return mechanism.

FIFO, on the other hand, is an acronym of "first in first out" and is synonymous with "first come, first served". As such, FIFO applies to queues rather than stacks. We use a queue when we wish to process elements in the same order they arrive.

User Avatar

Wiki User

7y ago

What else can I help you with?

Continue Learning about Engineering

What is Usage of stack register?

The stack register points to the top of the stack for the currently executing thread. The stack is a fixed-length memory allocation at the bottom of addressable memory (highest available address). The stack extends upwards into lower addresses. To keep track of the stack's usage, the stack pointer marks the top of the stack where a new frame will be pushed, decrementing the stack pointer by the required amount. When a frame is popped, the stack pointer is incremented by the frame length. The stack is typically used to call and return from functions by storing the return address of the caller, but can also be used to store a function's arguments (the values passed to it by its caller), its local variables and its exception handlers. Since the memory is allocated as soon as the thread becomes active, moving a pointer to activate and release stack frames is much quicker than requesting heap memory via the operating system.


Define list of operation on stack?

There are 4 main widely used stack operations.Operations:* POP - increase stack pointer and return top element * PUSH - putting element into stack's top * TOP - returns data of top element on stack * LENGTH/SIZE - returns number of elements inside stack For more detailed implementation details, please check web links.


Can you access data in the middle of the stack?

Usually not, but it depends on the context, I mean what kind of stack are you talking about. For example in FORTH language word PICK and ROLL could be used.


What is implicit stack?

A stack created by the user or a programmer is an implicit stack


Pseudo-code for stack operation?

Here's a simple pseudo-code for basic stack operations: initialize stack push(value): if stack is full: print "Stack Overflow" else: stack[top] = value top = top + 1 pop(): if stack is empty: print "Stack Underflow" return None else: top = top - 1 return stack[top] peek(): if stack is empty: print "Stack is empty" return None else: return stack[top - 1] This pseudo-code includes functions for pushing a value onto the stack, popping a value from the stack, and peeking at the top value without removing it.