Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshyadav committed Nov 24, 2020
1 parent 4c9c559 commit 1c51585
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
@@ -1,4 +1,7 @@
{
"eslint.enable": true,
"eslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}
5 changes: 3 additions & 2 deletions src/heap/index.js
Expand Up @@ -40,7 +40,7 @@ class Heap {
delete (data) {
let index = 0

if (data) {
if (data !== undefined) {
index = find(this.array, data)
}

Expand All @@ -51,7 +51,8 @@ class Heap {
this.heapifyDown(index)
}

heapifyDown (index) {
heapifyDown (i) {
let index = i
while (this.hasLeftChild(index)) {
let smallerChildIndex = this.getLeftChildIndex(index)
if (this.hasRightChild(index) &&
Expand Down

0 comments on commit 1c51585

Please sign in to comment.