710 views

1 Answer

0 votes
0 votes

S1: In the worst case , middle element of array will be deleted,then we have to adjust the position of (n/2) elements, which will take O(n) time,

S2: Just Interchange, two variables First & Last in O(1) Then print from first to last , elements will be printed in reverse order.

Option (b)

Related questions

1 votes
1 votes
0 answers
1
srestha asked May 24, 2019
1,322 views
$1)$How circular queue can be implemented?$2)$ For which data structure circular queue cannot be implemented?$(A)$Array $(B)$ Singly Linked List $(C)$ Doubly Linked List...
1 votes
1 votes
2 answers
2
srestha asked Oct 29, 2017
2,779 views
The initial configuration of circular queue as followsWhat is status of states of queue contents after the following sequence of stepsenqueue xdequeueenqueue ydequeuedequ...
0 votes
0 votes
0 answers
3
target2017 asked Jan 21, 2017
961 views
Doubt: dequeue really deletes the element or just moves the pointer? I'm not getting the answer.