2 votes 2 votes A priority queue is implemented as a Max-Heap. Initially, it has $5$ elements. The level-order traversal of the heap is: $10,8,5,3,2$. Two new elements $1$ and $7$ are inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is $10,8,7,3,2,1,5$ $10,8,7,2,3,1,5$ $10,8,7,1,2,3,5$ $10,8,7,5,3,2,1$ DS nielit2017july-scientistb-cs data-structures priority-queue binary-heap + – admin asked Mar 30, 2020 • retagged Oct 28, 2020 by Krithiga2101 admin 1.1k views answer comment Share Follow See 1 comment See all 1 1 comment reply haralk10 commented Apr 2, 2020 reply Follow Share Same questiion asked from GATE CS 2014 : https://gateoverflow.in/1967/gate2014-2-12 2 votes 2 votes Please log in or register to add a comment.
1 votes 1 votes After inserting 1: 10, 8, 5, 3, 2, 1 After inserting 7: 10, 8, 7, 3, 2, 1, 5 Hence, option A. AkashChandraGupta answered Aug 6, 2020 AkashChandraGupta comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Its MAX heap. Before insertion, BFS was 10,8,5,3,2. On insertion maintain the property of complete tree plus max heap. Thus the bfs traversal will be 10,8,7,3,2,1,5. Hence option A is correct rish1602 answered Jul 8, 2021 rish1602 comment Share Follow See all 0 reply Please log in or register to add a comment.