listsstacksand queues further examples include the followingr calls to large companies are generally placed on queue when all operators are busy in large universitieswhere resources are limitedstudents must sign waiting list if all computers are occupied the student who has been at computer the longest is forced off firstand the student who has been waiting the longest is the next user to be allowed on whole branch of mathematics known as queuing theory deals with computingprobabilisticallyhow long users expect to wait on linehow long the line getsand other such questions the answer depends on how frequently users arrive to the line and how long it takes to process user once the user is served both of these parameters are given as probability distribution functions in simple casesan answer can be computed analytically an example of an easy case would be phone line with one operator if the operator is busycallers are placed on waiting line (up to some maximum limitthis problem is important for businessesbecause studies have shown that people are quick to hang up the phone if there are operatorsthen this problem is much more difficult to solve problems that are difficult to solve analytically are often solved by simulation in our casewe would need to use queue to perform the simulation if is largewe also need other data structures to do this efficiently we shall see how to do this simulation in we could then run the simulation for several values of and choose the minimum that gives reasonable waiting time additional uses for queues aboundand as with stacksit is staggering that such simple data structure can be so important summary this describes the concept of adts and illustrates the concept with three of the most common abstract data types the primary objective is to separate the implementation of the adts from their function the program must know what the operations dobut it is actually better off not knowing how it is done listsstacksand queues are perhaps the three fundamental data structures in all of computer scienceand their use is documented through host of examples in particularwe saw how stacks are used to keep track of function calls and how recursion is actually implemented this is important to understandnot just because it makes procedural languages possiblebut because knowing how recursion is implemented removes good deal of the mystery that surrounds its use although recursion is very powerfulit is not an entirely free operationmisuse and abuse of recursion can result in programs crashing exercises you are given listland another listpcontaining integers sorted in ascending order the operation printlots( ,pwill print the elements in that are in positions specified by for instanceif the elements in positions and in are printed write the procedure printlots( ,pyou may use only the public stl container operations what is the running time of your procedure