which position will the ninth element be added?

 

Consider a standard Circular Queue implementation (which has the same condition for Queue Full and Queue Empty) whose size is 1111 and the elements of the queue are q[0],q[1],…q[10]q[0],q[1],…q[10].

The front and rear pointers are initialized to point at q[2]q[2]. In which position will the ninth element be added?

  1. q[0]q[0]
  2. q[1]q[1]
  3. q[9]q[9]
  4. q[10]
2Comments
Parth Sharma @parthsharmau
23 Apr 2017 03:28 pm

Since it is given that front =rear =2 so first element must be at 3rd index as per standard queue logic , secind element must be at index no. 4 .....9th must be at index 0 

 

shweta @shweta1920
23 Apr 2017 04:01 pm