Dequeue() operations take O(1) time to complete. It will take O(N) time to eliminate N elements from the queue (in total). The time required for one enqueue () operation is O(1). The time required to add N elements to the queue is O(N) (in total).
For a single operation, insertion has an O(1) time complexity and deletion, in the worst case, has an O(n) time complexity. Since it still takes O(n) time to delete n elements from the queue, the amortised costs for both are O(1).
In a balanced binary search tree, the time complexity for a single search is O(log(n)). The difficulty of the question may force you to perform n searches in the binary tree, making it O(nlog(n)) in total. A single search in an unbalanced binary search tree has a worst-case complexity of O. (n).
Learn more about queue:
https://brainly.com/question/24275089
#SPJ4