我无法得到正确的答案。 int height(Node* root) {
// Write your code here.
if (root == NULL)
return 0;
// find the height of each subtree
int lh = height(root->left);
int rh =
的复杂性我有个优先级队列的最大堆,每个元素都是一个叫任务类,如下所示(在Java中实现,但问题是语言无关): class Task{
int ID
int Priority
int Time
public Task(int i, int p, int t){
this.ID = i;
this.Priority = p;