wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structures - Queues

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

Which type of queue allows for the removal of elements based on priority rather than order of insertion?

a)

Linear queue

b)

Circular queue

c)

Priority queue

d)

Stack

2.

Which category does the data type 'queue' best fit into?

a)

Elementary data type

b)

Composite data type

c)

Abstract data type

d)

None of the above

3.

Identify the data type category for 'string'.

a)

Elementary data type

b)

Composite data type

c)

Abstract data type

d)

None of the above

4.

Which of the following is considered an elementary data type in computer programming?

a)

List

b)

Stack

c)

Integer

d)

Queue

5.

Which data type category does a 'stack' belong to?

a)

Elementary data type

b)

Composite data type

c)

Abstract data type

d)

None of the above

6.

What is an abstract data type (ADT) primarily concerned with?

a)

The physical structure of data

b)

The logical description of data and operations

c)

The speed of data processing

d)

The security of data

7.

Which example describes a queue in the context of abstract data types?

a)

A list of tasks to do (add to the end, remove most important)

b)

A stack of books (add to top, remove from top)

c)

A queue of print jobs (add to the rear, remove from front)

d)

A database of user information (add new users, delete old users)

8.

Which of the following is an example of a queue in real life information processing systems?

a)

Printer job queue

b)

Least recently used cache

c)

Stack of plates

d)

Priority interrupt handling

9.

Which operation is typically performed on a queue?

a)

Push

b)

Pop

c)

Enqueue

d)

Access the middle element

10.

What is the operation called when removing an item from a queue?

a)

Enqueue

b)

Dequeue

c)

Peek

d)

Clear

11.

Which of the following is NOT an operation on a queue?

a)

Add item to the rear of the queue

b)

Remove item from the front of the queue

c)

Check if the queue is empty

d)

Reverse the order of items

12.

What is the purpose of using pointers instead of refilling memory locations with blanks in CPU operations?

a)

To increase the processing speed

b)

To decrease the memory usage

c)

To simplify the programming process

d)

To enhance the graphical user interface

13.

What does the 'front' pointer indicate in a queue data structure?

a)

It points to the last item added

b)

It points to the next item to remove

c)

It points to the middle of the queue

d)

It indicates the total number of items in the queue

14.

What must be specified when a queue is initialised to prevent it from becoming too full?

a)

Initial item

b)

maxSize

c)

Minimum size

d)

Type of items

15.

What variable might be necessary to track the number of items currently in the queue?

a)

count

b)

size

c)

number

d)

length

16.

Why can't items be added to a full queue?

a)

It is not initialized

b)

It has reached its maxSize

c)

It does not contain any items

d)

It is not empty

17.

What does the enQueue function do in a queue data structure?

a)

Removes an item from the rear

b)

Adds an item to the rear

c)

Indicates if the queue is empty

d)

Indicates if the queue is full

18.

What is the purpose of the deQueue function in a queue?

a)

Adds an item to the front

b)

Removes and returns an item from the front

c)

Checks if the queue is full

d)

Adds an item to the rear

19.

What does isEmpty indicate in a queue?

a)

If the queue is full

b)

An item is added to the rear

c)

If the queue is empty

d)

An item is removed from the front

20.

What does isFull indicate about a queue?

a)

There is space for more items

b)

If the queue is empty

c)

An item can be removed from the front

d)

If the queue is full

21.

What is a common problem with implementing a queue using a fixed-size array?

a)

The size of the queue can dynamically increase as needed.

b)

Items can be added indefinitely without any issues.

c)

There is a limit to how many items can be added, which is fixed.

d)

Queues implemented with arrays can process items faster than those with linked lists.

22.

What happens when a queue implemented as a fixed-size array becomes full?

a)

It automatically expands to accommodate more items.

b)

It allows overwriting of existing items.

c)

It stops accepting new items until space is freed.

d)

The array type changes to a dynamic array.

23.

How can the limitations of a fixed-size array be overcome when implementing a queue?

a)

By allowing the array to decrease in size automatically.

b)

By using a linked list instead of an array.

c)

By periodically deleting items from the array.

d)

By converting the array to a stack.

24.

What is the primary advantage of a circular queue over a linear queue?

a)

It allows for faster access to elements.

b)

It uses memory more efficiently by reusing freed spaces.

c)

It automatically prioritizes elements.

d)

It requires less code to implement.

25.

How can you test for a full queue in a circular queue implementation?

a)

Check if the front pointer equals the rear pointer

b)

Check if the queue size equals the number of elements inserted

c)

Check if the rear pointer is one position behind the front pointer

d)

Check if the queue has no elements