Question: Write a function intgetCount(QUEUE q) to count the number of elements in a circular queue without using any looping statements. Initial value of front (F)
Write a function intgetCount(QUEUE q) to count the number of elements in a circular queue without using any looping statements. Initial value of front (F) and rear (R) is zero. Each time after inserting an element into the queue the rear pointer points to the last element inserted. Front pointer always points to a location previous to the element to be deleted as shown in the figure below. Assume that neither Insert function nor the queue maintains the count information.
Trace the algorithm for the following cases

a. F-0 R-4 b. R=1 F=2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
