I'm preparing my study material to study for an upcoming test, I was wondering if you can help me provide a short but sweet way of memorizing these topics, regarding Stack:what is postpone obligations and what are the advantages/disadvantages of using Stack? If this counts as 2 questions and I need to choose only one, understanding what postpone obligations would be my question please.
I'm preparing my study material to study for an upcoming test, I was wondering if you can help me provide a short but sweet way of memorizing these topics, regarding Stack:what is postpone obligations and what are the advantages/disadvantages of using Stack? If this counts as 2 questions and I need to choose only one, understanding what postpone obligations would be my question please.

Understand the concept of Proposed Obligations by the example shown below-
Suppose a person is relaxing in your garden, sitting on chair and reading the newspaper and the phone rings. He makes a mental note of where he stops reading as he stands to answer the phone. While chatting on the phone with his friend, the doorbell chimes. He says, "just a minute, hold that thought" and put the phone down as he answers the door, as he is about to sign for the package that is being delivered, his dog Tommy runs out the open door. Further, he brings Tommy back to home, then sign for the package, then finish the phone call, and finally return to read the newspaper. In this way, that person has been storing his postponed obligations on a mental stack! Each time he is interrupted, he pushes the current obligation onto this stack and then, when he is free, he pops it from the stack and resume handling it.
Stacks are very useful abstract data types, especially in the field of computing system software. They are most often used in situations, like the example above, in which we must deal with postponed obligations. Similarly, in programming language systems typically use a stack to keep track of operation calls. The main program calls operation. A, calls operation B, which in turn calls operation C, when at last C finishes, the flow of control returns to B, the postponed obligation; when B finishes, control returns to A, the previous postponed obligation; and so on. The call and return sequence are essentially a LIFO sequence of post-poned obligations.
Stacks are often used to store postponed obligations. When the previous obligation is removed from the Stack in which it was Stored and processing continues many variations on this theme occur within computing systems software, including call-return stacks and process stacks.
Step by step
Solved in 2 steps









