Break the problem up into steps...you could do so by splitting the insertion into 2 steps: add the node to the binary tree, then rotate the node (if needed) based upon priority. You could do both...