二叉搜索树(数组实现)+天梯赛题目L2-004 这是二叉搜索树吗?
1.二叉搜索树的建树用插入的方法建树void build(int root,int x){ if(tree[root]==-1){//空的 tree[root]=x; return; } if(tree[root]>=x){//往左 build(root*2,x); } else{//往右 build(root*2+1,x); }}2.二叉搜索树的查找首先和根节点比,如果比根节点小,就往左边查,如果比根节点大,就往右边查,直到找到或完全找不到为止boo






