
算法
lydxwj
慢慢踩坑
展开
-
算法入门之二叉树遍历顺序
二叉树遍历顺序 四种遍历方式 先/前序遍历、中序遍历、后序遍历、层序遍历 测试二叉树创建 function BinaryTree() { this.root = null; this.insert = function (key) { var node = new BinaryNode(key); if (this.root) { this._insertNode(node, this.root); } else { this.root = new BinaryNode(key)原创 2020-11-24 23:44:18 · 314 阅读 · 0 评论 -
算法入门一
二叉树创建 function BinaryTree() { this.root = null; this.insert = function (key) { var node = new BinaryNode(key); if (this.root) { this._insertNode(node, this.root); } else { this.root = new BinaryNode(key); }转载 2020-08-25 23:38:56 · 151 阅读 · 0 评论