Thread: Is My Interpretation of This Program Implementing a Stack Correct?

  1. #16
    Registered User
    Join Date
    Dec 2016
    Posts
    45
    That also is helpful in refining my understanding because I think I have been assuming the "top" to be pointing to the right-most slot to be filled with a value. Rather than 1 slot (unfilled) ahead of it.

    This Youtube video wasn't that clear on this subject: What is a Stack Data Structure - An Introduction to Stacks - YouTube

    Otherwise, everything you typed make sense on first reading before I went back and considered the part about the top's actual position
    Last edited by potomac; 12-23-2016 at 01:12 PM.

  2. #17
    Old Took
    Join Date
    Nov 2016
    Location
    Londonistan
    Posts
    121
    A stack is a conceptually very simple data structure that basically models a stack of paper that you can add a sheet to or take the top sheet from. It's an area of memory ( in your case a global array) that you can put data into with the express wish that the last item you entered will be the first one out.
    They are very useful structures. For instance a stack is often used to implement undo/redo features.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C program, making a stack and implementing it
    By wright.joshua92 in forum C Programming
    Replies: 11
    Last Post: 07-03-2015, 05:53 PM
  2. Implementing stack using class template
    By Trey Brumley in forum C++ Programming
    Replies: 11
    Last Post: 12-05-2013, 10:50 PM
  3. Help implementing a stack
    By 9erNumber16 in forum C Programming
    Replies: 15
    Last Post: 04-12-2012, 11:23 PM
  4. Please ..err..nitpick my code (implementing a stack)
    By manasij7479 in forum C++ Programming
    Replies: 6
    Last Post: 10-04-2011, 05:20 PM
  5. implementing a stack with template
    By micha_mondeli in forum C++ Programming
    Replies: 5
    Last Post: 03-31-2005, 07:08 PM

Tags for this Thread