\(getItemWithHighest\Pr iority\left(\right)\){
1. if A.heap-size < 1
error "heap underflow"
2. max = A[1]
3. A[1] = A[A.heap-size]
4. A.heap-size = A.heap-size - 1
5. Remove <item, index> from AVL for max. // O(log n)
6. Max-Heapify(A, 1) // O(log n)
7. return max
Time Complexity Analysis: Worst case could take maximum of O(log n) time.
Space Complexity Analysis: Max heapify may take log n space to save log n recursivecalls to itself. Thus O(log n)