如何找到BST中总和与给定值相同的两对?

时间:2015-10-31 11:28:14

标签: c++ binary-tree binary-search-tree

我试图找到两对,它们的总和与二进制搜索树中的给定数字相同但是,我没有得到正确答案,请有人帮助我。我的代码如下:

string function getComponentLocation( required string pathToComponent ) {

    var normalizedPath  = replaceNoCase(ARGUMENTS.pathToComponent, ".", "/", "ALL");
    var resolvedPath    = expandPath(normalizedPath);
    var fileLocation    = (resolvedPath & ".cfc");

    return fileLocation;
}

}

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

 find_sum(root1,root2->right,sum);
 find_sum(root1,root2->left,sum);
相关问题