Consider the following function: void f(Queue Q) { int i; if (!Empty(Q)) { i =…

Consider the following function:

void f(Queue Q) {

int i;

if (!Empty(Q)) {

i = ______ A ______;

f(Q);

______ B ______;

}

}

What operations must be performed at A and B so that the Queue will be reversed?

  1. A.

    A = insert(i, Q) B = insert(i, Q)

  2. B.

    A = insert(i, Q) B = delete(Q)

  3. C.

    A = delete(Q) B = insert(i, Q)

  4. D.

    A = delete(Q) B = delete(Q)

Attempted by 587 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…