Imagine we have the following RST, where nodes are (key, priority) tuples: Gravizo I 42 E M 21 40 C L 10 20 30 Its edge list is the following: (E, 21) -> (C,10) (1,42) -> (E, 21) (1,42) -> (M,40) (M,40) -> (L, 20) (M, 40) -> (N, 30) Provide a single (key, priority) tuple that, when inserted into this RST, will make the RST perfectly balanced and will not cause any AVL rotations during the insertion. Assume priorities must be positive integers and that we cannot have duplicate keys nor priorities.

icon
Related questions
Question
Imagine we have the following RST, where nodes are (key, priority) tuples:
Gravizo
I
42
E
M
21
40
C
L
N
10
20
30
Its edge list is the following:
(E, 21) -> (C, 1e)
(1,42) -> (E, 21)
(1,42) -> (M, 40)
(M, 40) -> (L, 20)
(M, 40) -> (N,30)
Provide a single (key,priority) tuple that, when inserted into this RST, will make the RST perfectly balanced
and will not cause any AVL rotations during the insertion. Assume priorities must be positive integers and that
we cannot have duplicate keys nor priorities.
Transcribed Image Text:Imagine we have the following RST, where nodes are (key, priority) tuples: Gravizo I 42 E M 21 40 C L N 10 20 30 Its edge list is the following: (E, 21) -> (C, 1e) (1,42) -> (E, 21) (1,42) -> (M, 40) (M, 40) -> (L, 20) (M, 40) -> (N,30) Provide a single (key,priority) tuple that, when inserted into this RST, will make the RST perfectly balanced and will not cause any AVL rotations during the insertion. Assume priorities must be positive integers and that we cannot have duplicate keys nor priorities.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer