Bug fixes to C code.

This commit is contained in:
krahets
2023-11-01 05:14:22 +08:00
parent f7dd05e7a4
commit 355cc3a6b1
31 changed files with 246 additions and 219 deletions

View File

@ -109,7 +109,7 @@ void showTrunks(Trunk *p) {
}
/* Print a binary tree */
void printTree(TreeNode *root, Trunk *prev, bool isLeft) {
void printTree(TreeNode *root, Trunk *prev, bool isRight) {
if (root == nullptr) {
return;
}
@ -121,7 +121,7 @@ void printTree(TreeNode *root, Trunk *prev, bool isLeft) {
if (!prev) {
trunk.str = "———";
} else if (isLeft) {
} else if (isRight) {
trunk.str = "/———";
prev_str = " |";
} else {