MCQOPTIONS
Saved Bookmarks
| 1. |
Consider a stack S of size n ≥ 1 which is initially empty. In an empty stack first n natural numbers are pushed in sequence and then n pop operations are performed. Push and pop operations take x seconds each. The time elapse between the end of one stack operation and the start of the next operation is y. For m ≥ 1, define the stack-life of m as the time elapsed from the end of push (m) to the start of the pop operation that removes m from stack S. What is the average stack-life of an element of this stack? |
| A. | 3y + 2x |
| B. | n (x + y) - x |
| C. | n (x + y) |
| D. | y + 2x |
| Answer» C. n (x + y) | |