Chapter 8: Problem 35
The following algorithm (used for Exercises 34-36) is a count-controlled loop going from 1 through 5 . At each iteration, the loop counter is either printed or put on a queue, depending on the result of Boolean function RanFun(). (The behavior of RanFun() is immaterial.) At the end of the loop, the items on the queue are dequeued and printed. Because of the logical properties of a queue, this algorithm cannot print certain sequences of the values of the loop counter. You are given an output and asked if the algorithm could generate the output. Respond as follows: A. True B. False C. Not enough information The following output is possible using a queue: 13542 .
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.