Algorithms in Java, Parts 1-4 (3rd Edition) (Pts.1-4)

   

9.1 A letter means insert and an asterisk means remove the maximum in the sequence

P R I O * R * * I * T * Y * * * Q U E * * * U * E.

Give the sequence of values returned by the remove the maximum operations.

9.2 Add to the conventions of Exercise 9.1 a plus sign to mean join and parentheses to delimit the priority queue created by the operations within them. Give the contents of the priority queue after the sequence

(((P R I O *) + (R * I T * Y *))* * *) + (Q U E * * * U * E).

   
Top

Категории