This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code was taken from the "JavaScript Data Structures and Algorithms" by Sammie Bae | |
// from the repository https://github.com/Apress/js-data-structures-and-algorithms, | |
// refactored to classes, and fixed the problem of adding '0' as the node value | |
// (it's not working correctly in the origin repository) | |
class Heap { | |
items = []; | |
constructor(values){ |