Hello! In this 5th post about JavaScript data structures and algorithms I will be discussing trees and how we run insert, append, prepend, traverse, and delete operations for then. ...
Trees are data structures that consist of a parent node, and two child nodes, referred to as the left child and right child, respectively:
class Node {
constructor(value){
this.left = null;
this.right = null;
this.value = value;
}
}
class BinarySearchTree {
constructor(){
this.root = null;
}
...
}
}
}
}
Top comments (0)