0

I have been struggling with this question in my data structures textbook. I know how the f and r pointers in circular queue works, however, I am having a bit of a trouble cracking this question in my text book. I would be grateful if someone can please guide me or provide some hints. The question is as follows :

Suppose an initially empty circular queue Q has performed a total of 32 enqueue operations, 6 first operations, and 15 dequeue operations, 5 of which returned null to indicate an empty queue.

given that the size of the cicular queue never exceeded 30, what would be the value of the variable f after all operations have been performed?

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
  • Can you provide a minimal code example? – Xan-Kun Clark-Davis Feb 21 '18 at 18:52
  • heres what I have come up with so far : there are 32 enqueue operations, 15 dequeue (10 of which are successful) and 6 first operations (does not have an effect on the queue). the only one to increment the value of f is dequeue So i know that only dequeue operations have an effect on f, but it also says that the size of queue never exceeds 30. I am not sure how to proceed from there – Naharul Hayat Feb 21 '18 at 19:11

0 Answers0