diff --git a/cpp/hello_world/src/ArraySort.cpp b/cpp/hello_world/src/ArraySort.cpp index 7bdf81c..d17a5bf 100644 --- a/cpp/hello_world/src/ArraySort.cpp +++ b/cpp/hello_world/src/ArraySort.cpp @@ -25,7 +25,10 @@ class ArraySort { int p = (left + right) / 2; int value = array[p]; - while(left < right) { +// 10 +// 1, 2, 15, 16, 10, 4, 5, 10, 20, 3 +// 1, 2, 3, 10, 5, 4, 10, 16, 20, 15 + while(left <= right) { while (array[left] < value) { left++; } diff --git a/javascript/2019/avlTree.js b/javascript/2019/avlTree.js index 87aacc7..7028fa4 100644 --- a/javascript/2019/avlTree.js +++ b/javascript/2019/avlTree.js @@ -48,7 +48,7 @@ class AVLTree { node.left = oldChild; newRoot.right = node; node.updateHeight(); - newRoot.updateHeight() + newRoot.updateHeight(); return newRoot; } leftRotation(node) { @@ -57,7 +57,7 @@ class AVLTree { node.right = oldChild; newRoot.left = node; node.updateHeight(); - newRoot.updateHeight() + newRoot.updateHeight(); return newRoot; } balance(root, value) {