Ask Question
20 August, 00:34

Suppose an initially-empty queue Q has performed a total of 32 enqueue operations, 10 front operations, and 15 dequeue operations, 5of which generated EmptyQueueExceptions, which were caught and ignored. What is the current size of Q?

+3
Answers (1)
  1. 20 August, 04:13
    0
    22

    Explanation:

    1. We are going to have at hand 32 Enqueue Operation, with 10 from front and 15 dequeue and 5 empty queue operation

    2. You dequeued total number of 15-5 = 10 elements since 5 dequeue did not change the state of the queue, so invariably 10 dequeue is done.

    3. Next is to enqueued a total of 32 elements.

    Enqueue Operation do not change the state (and Size) of the queue, and can be ignored.

    4. To arrive at the Total Size of queue, we will have 32-10 = 22 at the end

    Answer : 22 because its a 5 dequeue Operations.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Suppose an initially-empty queue Q has performed a total of 32 enqueue operations, 10 front operations, and 15 dequeue operations, 5of ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers