摘要:
static int tree_height(const Node* root, int& max_distance){ const int left_height = root->left ? tree_height(root->left, max_distance) + 1 : 0; const int right_height = root->right ? tree_height(root->right, max_distance) + 1 : 0; const int distance = left_height + right_height; if 阅读全文