2 votes 2 votes When the priority queue is represented by max heap, the insertion and deletion of an element can be performed in (queue containing $n$ elements) $\theta(n)$ and $\theta(1)$ respectively $\theta(n)$ and $\theta(n)$ respectively $\theta(1)$ and $\theta(1)$ respectively None of the above Others ugcnetcse-june2011-paper2 data-structures queue binary-heap + – makhdoom ghaya asked Aug 24, 2016 retagged Oct 23, 2018 by Pooja Khatri makhdoom ghaya 2.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 4 votes 4 votes D is answer Inserting Element take O(logn ) in worst case.(insert at least then find its correct possition) Deletion Element take O(logn ) in worst case.( 1st we have to search that element) Prashant. answered Aug 25, 2016 selected Sep 13, 2017 by sourav. Prashant. comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Ans: D We can use heaps to implement the priority queue. It will take O(log N) time to insert and delete each element in the priority queue. ref: https://www.hackerearth.com/practice/notes/heaps-and-priority-queues/ rishu_darkshadow answered Sep 13, 2017 rishu_darkshadow comment Share Follow See all 0 reply Please log in or register to add a comment.