二叉搜索树
// 节点
class Node{
constructor(value){
this.value=value;
this.left=null;
this.right=null;
}
}
// 二叉搜索树
class BinarySearchTree{
constructor(){
this.root=null;
}
// 插入节点到合适位置
insertNode(node,newNode){
// 判断新节点与当前节点的大小,然后小放左大放右
原创
2021-04-15 22:11:44 ·
64 阅读 ·
0 评论