stacks and queues of coursemany people don' rigorously follow this top-to-bottom approach they mayfor exampletake the mail off the bottom of the stackso as to process the oldest letter first or they might shuffle through the mail before they begin processing it and put higher-priority letters on top in these casestheir mail system is no longer stack in the computer-science sense of the word if they take letters off the bottomit' queueand if they prioritize itit' priority queue we'll look at these possibilities later another stack analogy is the tasks you perform during typical workday you're busy on long-term project ( )but you're interrupted by coworker asking you for temporary help with another project (bwhile you're working on bsomeone in accounting stops by for meeting about travel expenses ( )and during this meeting you get an emergency call from someone in sales and spend few minutes troubleshooting bulky product (dwhen you're done with call dyou resume meeting cwhen you're done with cyou resume project band when you're done with byou can (finally!get back to project lower-priority projects are "stacked upwaiting for you to return to them placing data item on the top of the stack is called pushing it removing it from the top of the stack is called popping it these are the primary stack operations stack is said to be last-in-first-out (lifostorage mechanism because the last item inserted is the first one to be removed the stack workshop applet let' use the stack workshop applet to get an idea how stacks work when you start up this appletyou'll see four buttonsnewpushpopand peekas shown in figure figure the stack workshop applet