Check sibling questions

Define stack.

Answer:

A stack is a data structure in which elements are arranged in a linear order. 

In a stack, insertion and deletion takes place at one end i.e., the top of the stack. 

 

STACK - Teachoo.png

Additional points: 

  • Inserting into a stack is called a PUSH operation and deleting from a stack is called a POP operation.
  • A stack follows the LIFO principle i.e., an element which is inserted last will be the first one to be taken out.

983 students joined Teachoo Black. What are you waiting for?


Transcript

Define stack. Answer: A stack is a data structure in which elements are arranged in a linear order. In a stack, insertion and deletion takes place at one end i.e., the top of the stack. Additional points: Inserting into a stack is called a PUSH operation and deleting from a stack is called a POP operation. A stack follows the LIFO principle i.e., an element which is inserted last will be the first one to be taken out.

Davneet Singh's photo - Teacher, Engineer, Marketer

Made by

Davneet Singh

Davneet Singh is a graduate from Indian Institute of Technology, Kanpur. He has been teaching from the past 12 years. He provides courses for Maths and Science at Teachoo.