What is the time complexity of inserting an element into a binary heap-based priority queue in the worst-case scenario?
O(1)
O(n)
O(n log n)
O(log n)
Which real-world scenario is best represented using a priority queue?
Managing a print queue where documents are printed in the order they are received
Storing a history of visited web pages in a browser
Scheduling tasks in an operating system based on their priority levels
Maintaining a list of recently used applications
In a priority queue implementation using a sorted array, what is the time complexity of the dequeue operation in the worst-case scenario?
Which of the following data structures can be efficiently used to implement a priority queue?
Doubly Linked List
Binary Search Tree
Hash Table
Binary Heap
In a circular queue implemented using an array of size 5, if the front is at index 3 and the rear is at index 1, how many elements are present in the queue?
1
3
4
2
Which of the following operations is NOT efficiently supported by a standard queue data structure?
Search for a specific element
Enqueue at the rear
Dequeue from the front
Get the front element
What is the time complexity of inserting an element into a priority queue implemented using a binary heap (in the average case)?
In a scenario simulating a print queue, where print jobs with higher priority should be executed first, which queue implementation is most suitable?
Priority queue
Deque (Double-ended queue)
Simple queue
Circular queue
What happens when you dequeue from an empty circular queue?
The queue becomes full
An error is thrown
The operation has no effect
The front pointer moves to the next position
How does a circular queue determine if it is full?
Front pointer equals rear pointer
Rear pointer reaches the end of the array
Front pointer is one position behind the rear pointer (considering wrapping)
A separate variable keeps track of the number of elements