646 views

1 Answer

1 1 vote

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

Position:
Show:

Related questions

0 0 votes
2 2 answers
363
363 views
amar100 asked Feb 15, 2025
363 views
Common Data For Q. 10 \& Q. 11We have a 4-stage pipeline where$S_{1}=$ Fetch$S_{2}=$ Decode and calculate effective address$S_{3}=$ Fetch operand$S_{4}=$ Execute instruct...
0 0 votes
0 0 answers
297
297 views
eyeamgj asked Oct 16, 2018
297 views
https://gateoverflow.in/1269/gate2007-71 ANSWER SHOULD BE 11?? OR 21?
0 0 votes
0 0 answers
247
247 views
eyeamgj asked Oct 10, 2018
247 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 0 votes
0 0 answers
827
827 views
eyeamgj asked Sep 2, 2018
827 views
https://gateoverflow.in/20617/tifr2011-b-311+2(n-2) is correct ???i.e option d looks more correct....??