New answers tagged

0

In above example queue capacity is 8. A circular queue can have capacity - 1 elements. Here it is 7. While array doubling those 7 elements are copied. Then suppose front = 0 and rear = 7, then the elements from 1 to 7 has to be moved to the right. Here it copies 7 elements. Hence the total is 7 + 7 = 14. 2 * 8 - 2 = 14


Top 50 recent answers are included