Give any two characteristics of stacks.

Answer

A stack is like a stack of books

The Characteristics of Stacks are:  

  • It is a data structure which follows LIFO (Last-in-First-Out)
  • The insertion and deletion happens at the same end i.e. from the top of the stack
  • Stack is implemented through Array or Linked list .
  • Stack is used in many algorithms like Tower of Hanoi, tree traversals.
  • If the allocated space for stack is full , and any attempt to add more elements will lead to stack Overflow . The opposite , any attempt to extract elements on an empty stack leads to Stack Underflow .

Slide1.JPG

Slide2.JPG
Slide3.JPG

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo