File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,9 @@ int main() {
115115 int i = 1 ;
116116 int l = abt.left (i), r = abt.right (i), p = abt.parent (i);
117117 cout << " \n 当前节点的索引为 " << i << " ,值为 " << abt.val (i) << " \n " ;
118- cout << " 其左子节点的索引为 " << l << " ,值为 " << (l != INT_MAX ? to_string (abt.val (l)) : " nullptr" ) << " \n " ;
119- cout << " 其右子节点的索引为 " << r << " ,值为 " << (r != INT_MAX ? to_string (abt.val (r)) : " nullptr" ) << " \n " ;
120- cout << " 其父节点的索引为 " << p << " ,值为 " << (p != INT_MAX ? to_string (abt.val (p)) : " nullptr" ) << " \n " ;
118+ cout << " 其左子节点的索引为 " << l << " ,值为 " << (abt. val (l) != INT_MAX ? to_string (abt.val (l)) : " nullptr" ) << " \n " ;
119+ cout << " 其右子节点的索引为 " << r << " ,值为 " << (abt. val (r) != INT_MAX ? to_string (abt.val (r)) : " nullptr" ) << " \n " ;
120+ cout << " 其父节点的索引为 " << p << " ,值为 " << (abt. val (p) != INT_MAX ? to_string (abt.val (p)) : " nullptr" ) << " \n " ;
121121
122122 // 遍历树
123123 vector<int > res = abt.levelOrder ();
You can’t perform that action at this time.
0 commit comments