Search Header Logo

Queue Operations Quiz

Authored by Donna Callender

Computers

9th Grade

Used 1+ times

Queue Operations Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a dequeue operation?

Removes and returns the element from the front of the queue

Removes and returns the element from the rear of the queue.

Removes the element from the front of the queue.

Returns the element from the rear of the queue.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A queue is implemented in Python using the built-in list data structure. What Python method is used to implement enqueue() function?

insert()

append()

add()

delete()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If maxsize is equal to size of the array used in a circular queue (q), complete the pseudocode given for enqueue operation. function enQueue(element){ if q.isFull() print(‘Queue is full’) else rear=...................... q[rear]=newElement}

rear+1

(rear+1) MOD maxsize

(rear-1) MOD maxsize

(front-1) MOD maxsize

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What element does the rear pointer point to?

‘a’

‘b’

‘c’

‘d’

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of q? (Based on the following operations performed on a circular queue implemented using an array: q=Queue(4), q.enQueue(10), q.enQueue(20), q.enQueue(30), q.enQueue(40), q.deQueue(), q.enQueue(50))

[10, 20, 30, 40]

[10, 20, 30, 50]

[50, 10, 20, 30]

[50, 20, 30, 40]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is q.rear? (Based on the following operations performed on a circular queue implemented using an array: q=Queue(4), q.enQueue(10), q.enQueue(20), q.enQueue(30), q.enQueue(40), q.deQueue(), q.enQueue(50))

0

1

2

3

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If max size is equal to size of the array used in a circular queue (q), complete the pseudocode given for dequeue operation. function deQueue(){ if q.isEmpty(){ print(‘Queue is empty’) element=null} else{ .................................. .................................. } return element }

element=q[front] front=(front+1) MOD maxsize

element=q[rear] rear=(rear-1) MOD maxsize

element=q[front] front=(front-1) MOD maxsize

element=q[front+1] front=(front+1) MOD maxsize

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?