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
+3 -3
View File
@@ -44,12 +44,12 @@ function printTree(root: TreeNode | null) {
* Print a binary tree
* @param root
* @param prev
* @param isLeft
* @param isRight
*/
function printTreeHelper(
root: TreeNode | null,
prev: Trunk | null,
isLeft: boolean
isRight: boolean
) {
if (root === null) {
return;
@@ -62,7 +62,7 @@ function printTreeHelper(
if (prev === null) {
trunk.str = '———';
} else if (isLeft) {
} else if (isRight) {
trunk.str = '/———';
prev_str = ' |';
} else {