Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

what is a stack in programming

Wide-eyed Wombat answered on July 10, 2021 Popularity 10/10 Helpfulness 2/10

Contents


More Related Answers

  • How to create a stack data structure in Java?
  • java stack methods
  • Java Creating a Stack
  • what is mean stack
  • mean stack tutorial
  • stack push code
  • create stack data structure
  • stack data structure
  • create stack data structure
  • implement stack in python
  • Stack in python
  • create stack data structure
  • simplest code for stack implementation in c++
  • create stack data structure
  • create stack data structure
  • create stack data structure
  • what is stack
  • stack function
  • simplest code for stack implementation in c++
  • simplest code for stack implementation in c++
  • what is static stack
  • java program on stack for beginners
  • stack loop
  • create stack data structure
  • create stack data structure
  • create stack data structure

  • what is a stack in programming

    1
    Popularity 10/10 Helpfulness 2/10 Language whatever
    Source: Grepper
    Tags: stack whatever
    Link to this answer
    Share Copy Link
    Contributed on Jul 10 2021
    Wide-eyed Wombat
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    4

    First of all, let me describe what a stack is. Based on the name, it should be a relatively familiar concept.

    Let’s assume that we have four books with the following riveting titles:

    A

    B

    C

    D

    At the moment, these books are strewn out all over the floor and we want to stack them up neatly.

    Four books are lying all over the place.

    1 of 5

    Now we have a nice neat stack of books! If we want to retrieve a book from this stack, we can take the book on top. Taking a book from the bottom is a bit precarious and we don’t want to topple the entire stack. Therefore, we’ll take down the top book on the stack and read it or do whatever we want to do with it.

    Let’s say we want to take Book A. Right now, it is at the bottom of the stack, so we need to take Book D, put it down, then do the same for Book C and Book B, and then we can access Book A.

    This is the main idea of a stack. The data structure stack is very similar to a physical stack that you’d most likely be familiar with. The stack data structure allows us to place any programming artifact, variable or object on it, just as our example stack allowed us to put books in it.

    Popularity 10/10 Helpfulness 2/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 18 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10

    0
    Popularity 9/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 18 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10

    0
    Popularity 10/10 Helpfulness 1/10 Language cpp
    Source: Grepper
    Tags: c++
    Link to this answer
    Share Copy Link
    Contributed on Apr 12 2022
    Motionless Mink
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.