Fixing non compliant files (Ciphers, Conversions and Data Structures)

This commit is contained in:
Juliano Nunes
2020-05-03 21:26:52 -03:00
parent 14bab1b931
commit 2e0bd65b0c
8 changed files with 293 additions and 264 deletions

View File

@@ -12,7 +12,7 @@
// Functions: insert, delete, peek, isEmpty, print, heapSort, sink
class MinPriorityQueue {
// calss the constructor and initializes the capacity
// calls the constructor and initializes the capacity
constructor (c) {
this.heap = []
this.capacity = c
@@ -43,13 +43,12 @@ class MinPriorityQueue {
// returns boolean value whether the heap is empty or not
isEmpty () {
if (this.size == 0) return true
return false
return this.size === 0
}
// returns boolean value whether the heap is full or not
isFull () {
if (this.size == this.capacity) return true
if (this.size === this.capacity) return true
return false
}
@@ -111,7 +110,7 @@ class MinPriorityQueue {
}
// testing
q = new MinPriorityQueue(8)
const q = new MinPriorityQueue(8)
q.insert(5)
q.insert(2)