Stack

A stack is a collection of objects that are inserted and removed according to the last-in first-out (LIFO) principle. Objects can be inserted into a stack at any time, but only the most recently inserted object can be removed at any time. Basically, a stack is a data structure of ordered items such that items can be inserted and removed only at one end (called the top). When we say the items are ordered, we mean the order we can access them.Stacks are the simplest of all data structures, yet they are also among the most important, as they are used in a host of different applications that include many more sophisticated data structures. We will go over three applications of stacks. These examples are central to many activities that a computer must do: expression evaluationbacktracking (game playing, finding paths, exhaustive searching), and memory management.

Posted on by