By using the Max-Heap data structure to implement a priority queue, some applica
ID: 641433 • Letter: B
Question
By using the Max-Heap data structure to implement a priority queue, some applications may need to change the data (priority) of a specific node i. That is, given an index i, change the priority of node i to a new priority t. Please write a pseudocode for this procedure.
Max-Heap-update(A, i, t) {
}
____________________________________________________
Given an array A, we try to sort the array using the quicksort algorithm. In this sorting, assume on each recursive step the partition procedure always partition each subarray into n ? 2 to 2 ratio, where n is the size of the subarray. What