Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b4507f1

Browse files
committed
update: rename folder and fix condition for K
1 parent ca93db3 commit b4507f1

File tree

4 files changed

+2
-2
lines changed

4 files changed

+2
-2
lines changed
File renamed without changes.

‎src/_DataStructures_/Trees/BST/find-kth-max/index.js‎ renamed to ‎src/_DataStructures_/Trees/BinarySearchTree/find-kth-max/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function inOrderTraversal(root) {
1313

1414
function findKthMax(rootNode, k) {
1515
const arr = inOrderTraversal(rootNode);
16-
if (k < 0 || k > arr.lenth) {
16+
if (k <= 0 || k > arr.lenth) {
1717
throw new Error('Invalid value for K');
1818
}
1919
return arr[arr.length - k];

‎src/_DataStructures_/Trees/BST/find-kth-min/index.js‎ renamed to ‎src/_DataStructures_/Trees/BinarySearchTree/find-kth-min/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function inOrderTraversal(root) {
1414

1515
function findKthMin(rootNode, k) {
1616
const arr = inOrderTraversal(rootNode);
17-
if (k < 0 || k > arr.lenth) {
17+
if (k <= 0 || k > arr.lenth) {
1818
throw new Error('Invalid value for K');
1919
}
2020
return arr[k - 1];
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /