mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-03 13:43:06 +08:00
Update binary_search_tree.js
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
const Tree = require("../include/TreeNode");
|
const Tree = require("../include/TreeNode");
|
||||||
const { printTree } = require("../include/PrintUtil");
|
const { printTree } = require("../include/PrintUtil");
|
||||||
|
|
||||||
/* 二叉搜索树 */
|
/* 二叉搜索树 */
|
||||||
var root;
|
var root;
|
||||||
|
|
||||||
function BinarySearchTree(nums) {
|
function BinarySearchTree(nums) {
|
||||||
@ -143,4 +143,4 @@ console.log("\n删除结点 2 后,二叉树为\n");
|
|||||||
printTree(getRoot());
|
printTree(getRoot());
|
||||||
remove(4);
|
remove(4);
|
||||||
console.log("\n删除结点 4 后,二叉树为\n");
|
console.log("\n删除结点 4 后,二叉树为\n");
|
||||||
printTree(getRoot());
|
printTree(getRoot());
|
||||||
|
|||||||
Reference in New Issue
Block a user