This content originally appeared on DEV Community and was authored by Oscar Luna
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;
}
...
}
}
}
}
This content originally appeared on DEV Community and was authored by Oscar Luna
Oscar Luna | Sciencx (2021-04-24T03:35:23+00:00) JavaScript Data Structures and Algorithms (Trees, part 1). Retrieved from https://www.scien.cx/2021/04/24/javascript-data-structures-and-algorithms-trees-part-1/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.