Poem on Stack
k STACK - What, How, Why, Where? I am a data structure I hold elements from bottom to top You can see me in a tray of idli plates So I am a linear data structure And so my name is called stack Elements are inserted in me at the top From the same top elements are deleted So elements are removed in the reverse Order that they have been inserted And so I am well known for LIFO operation Let me introduce you my terminology Pointer TOP keeps track of the top element PUSH inserts an element and POP deletes OVERFLOW occurs if pushed when I am full UNDERFLOW occurs if popped when I am empty Let me tell you how I am implemented With arrays or linked lists I can be created At the beginning I am empty implies top = -1 Before pushing see whether I am overflowing For each push an element is inserted in me implies top++ Before popping see whether I am under flowing For each pop an element is taken out from me implies top-- Let me tell you where I am used...