NEW
Font size
WorksheetsData Structures - Queues
Total questions: 25
Worksheet time: 13mins
Which type of queue allows for the removal of elements based on priority rather than order of insertion?
Linear queue
Circular queue
Priority queue
Stack
Which category does the data type 'queue' best fit into?
Elementary data type
Composite data type
Abstract data type
None of the above
Identify the data type category for 'string'.
Elementary data type
Composite data type
Abstract data type
None of the above
Which of the following is considered an elementary data type in computer programming?
List
Stack
Integer
Queue
Which data type category does a 'stack' belong to?
Elementary data type
Composite data type
Abstract data type
None of the above
What is an abstract data type (ADT) primarily concerned with?
The physical structure of data
The logical description of data and operations
The speed of data processing
The security of data
Which example describes a queue in the context of abstract data types?
A list of tasks to do (add to the end, remove most important)
A stack of books (add to top, remove from top)
A queue of print jobs (add to the rear, remove from front)
A database of user information (add new users, delete old users)
Which of the following is an example of a queue in real life information processing systems?
Printer job queue
Least recently used cache
Stack of plates
Priority interrupt handling
Which operation is typically performed on a queue?
Push
Pop
Enqueue
Access the middle element
What is the operation called when removing an item from a queue?
Enqueue
Dequeue
Peek
Clear
Which of the following is NOT an operation on a queue?
Add item to the rear of the queue
Remove item from the front of the queue
Check if the queue is empty
Reverse the order of items
What is the purpose of using pointers instead of refilling memory locations with blanks in CPU operations?
To increase the processing speed
To decrease the memory usage
To simplify the programming process
To enhance the graphical user interface
What does the 'front' pointer indicate in a queue data structure?
It points to the last item added
It points to the next item to remove
It points to the middle of the queue
It indicates the total number of items in the queue
What must be specified when a queue is initialised to prevent it from becoming too full?
Initial item
maxSize
Minimum size
Type of items
What variable might be necessary to track the number of items currently in the queue?
count
size
number
length
Why can't items be added to a full queue?
It is not initialized
It has reached its maxSize
It does not contain any items
It is not empty
What does the enQueue function do in a queue data structure?
Removes an item from the rear
Adds an item to the rear
Indicates if the queue is empty
Indicates if the queue is full
What is the purpose of the deQueue function in a queue?
Adds an item to the front
Removes and returns an item from the front
Checks if the queue is full
Adds an item to the rear
What does isEmpty indicate in a queue?
If the queue is full
An item is added to the rear
If the queue is empty
An item is removed from the front
What does isFull indicate about a queue?
There is space for more items
If the queue is empty
An item can be removed from the front
If the queue is full
What is a common problem with implementing a queue using a fixed-size array?
The size of the queue can dynamically increase as needed.
Items can be added indefinitely without any issues.
There is a limit to how many items can be added, which is fixed.
Queues implemented with arrays can process items faster than those with linked lists.
What happens when a queue implemented as a fixed-size array becomes full?
It automatically expands to accommodate more items.
It allows overwriting of existing items.
It stops accepting new items until space is freed.
The array type changes to a dynamic array.
How can the limitations of a fixed-size array be overcome when implementing a queue?
By allowing the array to decrease in size automatically.
By using a linked list instead of an array.
By periodically deleting items from the array.
By converting the array to a stack.
What is the primary advantage of a circular queue over a linear queue?
It allows for faster access to elements.
It uses memory more efficiently by reusing freed spaces.
It automatically prioritizes elements.
It requires less code to implement.
How can you test for a full queue in a circular queue implementation?
Check if the front pointer equals the rear pointer
Check if the queue size equals the number of elements inserted
Check if the rear pointer is one position behind the front pointer
Check if the queue has no elements
