上一页 1 ··· 7 8 9 10 11 12 下一页
摘要: //选择排序 class ArrayList { constructor () { this.array = [] } insert (data) { return this.array.push(data) } tostring () { return this.array.join('-') } 阅读全文
posted @ 2020-02-25 20:51 前端之旅 阅读(106) 评论(0) 推荐(0)
摘要: //冒泡排序 class ArrayList { constructor () { this.array = [] } insert (data) { return this.array.push(data) } tostring () { return this.array.join('-') } 阅读全文
posted @ 2020-02-25 20:30 前端之旅 阅读(154) 评论(0) 推荐(0)
摘要: // 节点类 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 前端之旅 阅读(227) 评论(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 前端之旅 阅读(317) 评论(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 前端之旅 阅读(687) 评论(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 前端之旅 阅读(242) 评论(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 前端之旅 阅读(167) 评论(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 前端之旅 阅读(189) 评论(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 前端之旅 阅读(123) 评论(0) 推荐(0)
摘要: //双向循环链表 class DoubleNode { constructor (data) { this.data = data this.prev = null this.next = null } } class DoubleCycleList { constructor () { this. 阅读全文
posted @ 2020-02-23 21:30 前端之旅 阅读(401) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 下一页