cells. Find the number of elements in QUEUE if
(i) Front = 4, Rear =8.
(ii) Front = 10, Rear = 3.
(iii) Front = 5, Rear = 6 and then two elements are deleted
ans:
there are total of 12 elements
1 2 3 4 ..........8 9 10 11 12
f r --->total of there are 5 elements
1 2 3.............10 11 12
r f ----->it is circular fashion given in q ,,,the no of elements is 6(starts with front and ends with rear)
1 2 3 4 5 6 ..........12
f r---->after deletion of two elements result is zero.
No comments:
Post a Comment