291 views

1 Answer

1 votes
1 votes

See 2 comments are there,

Comment 1: we initialize front and rear as -1, so first element should be inserted at q[2].

Comment 2: Correct. So when we initialize to -1, the element is inserted at [0].

The question says

The front and rear pointers are initialized to point at q[2]

So, element is inserted at q[3]

I hope you understand

Related questions

0 votes
0 votes
0 answers
1
eyeamgj asked Oct 16, 2018
167 views
https://gateoverflow.in/1269/gate2007-71 ANSWER SHOULD BE 11?? OR 21?
0 votes
0 votes
0 answers
2
eyeamgj asked Oct 10, 2018
110 views
https://gateoverflow.in/749/gate2001-8 the answer of c par of this question should be 40% according to this https://gateoverflow.in/65890/input-output .................d...
0 votes
0 votes
0 answers
3
eyeamgj asked Sep 2, 2018
340 views
https://gateoverflow.in/20617/tifr2011-b-311+2(n-2) is correct ???i.e option d looks more correct....??
0 votes
0 votes
0 answers
4
eyeamgj asked Aug 27, 2018
129 views
https://gateoverflow.in/81359/gate1987-4aI AM GETTING 27 BY TAKING 4 BRANCH BITS ..IS IT RIGHT??