摘要: // 节点类 class Node { constructor(data) { this.data = data this.left = null this.right = null } } //平衡二叉树Balanced Binary Tree class BBT { constructor() 阅读全文
posted @ 2020-02-24 23:29 前端之旅 阅读(219) 评论(0) 推荐(0)
摘要: class Node { constructor (data) { this.data = data this.next = null } } class LinkList { constructor () { //初始化,空链表,长度为0 this.head = null this.length 阅读全文
posted @ 2020-02-24 22:32 前端之旅 阅读(312) 评论(0) 推荐(0)
摘要: //二叉树BST class Node { constructor (data) { this.data = data this.left = null this.right = null } } class BST { constructor () { this.root = null } ins 阅读全文
posted @ 2020-02-24 21:56 前端之旅 阅读(668) 评论(0) 推荐(0)
摘要: //二叉树BST class Node { constructor (data) { this.data = data this.left = null this.right = null } } class BST { constructor () { this.root = null } ins 阅读全文
posted @ 2020-02-24 20:19 前端之旅 阅读(225) 评论(0) 推荐(0)
摘要: //二叉树BST class Node { constructor (data) { this.data = data this.left = null this.right = null } } class BST { constructor () { this.root = null } ins 阅读全文
posted @ 2020-02-24 19:53 前端之旅 阅读(162) 评论(0) 推荐(0)
摘要: //递归 //阶乘 function factorial (n) { if (n == 0) return 1 return n * factorial(n - 1) } //斐波那契数列 function fibonacci (n) { if (n == 1 || n == 2) return 1 阅读全文
posted @ 2020-02-24 14:50 前端之旅 阅读(184) 评论(0) 推荐(0)
摘要: //集合,不允许重复,无序 class Gather { constructor () { this.items = {} } add (prop) { if (this.isHas(prop)) return false else this.items[prop] = undefined retu 阅读全文
posted @ 2020-02-24 10:35 前端之旅 阅读(110) 评论(0) 推荐(0)