175k views
4 votes
Stacks 1. In your own words define the data structure Stack 2. What does LIFO stand for, what does it mean, and how does that relate to a Stack? LIFO stands for: LIFO means: Relation to Stack: Queues 3. In your own words define the data structure Queue 4. What does FIFO stand for, what does it mean and how does that relate to a Queue? FIFO stands for: FIFO means:

1 Answer

7 votes

Answer and Explanation:

1. The fundamental linear structure of data that is thought as a physical stack or heap, logically, where inclusion and cancellation happens toward one side is known as the stack.

2. LIFO stands for Last In First Out

  • LIFO implies that the last component into the stack is the main component to leave ,utilized by stack.
  • The fundamental implementation of stack to demonstrate the manner in which it gets to the information.
  • At the point when a thing is added to stack ,it is set over every other thing in the stack and in the event that you need to erase the components ,at that point things are expelled from top of the stack.
  • Connection to Stack : LIFO is fundamental usage of stack and the down to earth execution of stack can be conceivable utilizing the cluster and connected rundown.
  • There are 3 operations on stack:

i) Push

ii) Pop

iii) Content display of stack (pip)

3. The essential straight information structure intelligently thought as a physical heap where the inclusions at one end(front) and erasures at another end(rear end).

4. FIFO stands for First In First Out.

  • FIFO implies: The primary component into the line is the principal component to leave the line, utilized by line.
  • The addition of components into line takes at backside and erasure of components takes at front end.
  • The backside is utilized to put new components over every single other component in line.
  • The front end is utilized to erase components from base of the queue(nothing however another end).
  • Fundamentally the front and back are pointers to components in the line.
  • Connection to Queue : FIFO is fundamental usage of stack and the down to earth execution of line can be conceivable utilizing the exhibit and connected rundown.
  • There are 3 operation on line :

i) Enqueue (insertion)

ii) Dequeue (deletion)

iii) Components display

User Ji Yalin
by
6.3k points