02 2020 档案

摘要://快速排序 class ArrayList { constructor () { this.array = [] } insert (data) { return this.array.push(data) } quickSort () { this.array = this.quick(this 阅读全文
posted @ 2020-02-26 20:35 前端之旅 阅读(151) 评论(0) 推荐(0) 编辑
摘要://快速排序 class ArrayList { constructor () { this.array = [] } insert (data) { return this.array.push(data) } quickSort () { this.array = this.quick(this 阅读全文
posted @ 2020-02-26 20:08 前端之旅 阅读(121) 评论(0) 推荐(0) 编辑
摘要://归并排序 class ArrayList { constructor () { this.array = [] } insert (data) { return this.array.push(data) } mergeSort () { this.array = this.merge_1(th 阅读全文
posted @ 2020-02-26 19:41 前端之旅 阅读(108) 评论(0) 推荐(0) 编辑
摘要://希尔排序 class ArrayList { constructor () { this.array = [] } insert (data) { return this.array.push(data) } shellSort () { let length = this.array.leng 阅读全文
posted @ 2020-02-26 19:01 前端之旅 阅读(168) 评论(0) 推荐(0) 编辑
摘要://选择排序 class ArrayList { constructor () { this.array = [] } insert (data) { return this.array.push(data) } tostring () { return this.array.join('-') } 阅读全文
posted @ 2020-02-25 20:51 前端之旅 阅读(95) 评论(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 前端之旅 阅读(136) 评论(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 前端之旅 阅读(213) 评论(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 前端之旅 阅读(303) 评论(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 前端之旅 阅读(661) 评论(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 前端之旅 阅读(220) 评论(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 前端之旅 阅读(155) 评论(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 前端之旅 阅读(178) 评论(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 前端之旅 阅读(106) 评论(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 前端之旅 阅读(378) 评论(0) 推荐(0) 编辑
摘要://单向循环链表 class Node { constructor (data) { this.data = data this.next = null } } class CycleList { constructor () { this.head = null this.length = 0 } 阅读全文
posted @ 2020-02-23 20:08 前端之旅 阅读(302) 评论(0) 推荐(0) 编辑
摘要://双向链表 class Node { constructor (data) { this.data = data this.prev = null this.next = null } } class DoubleList { constructor () { this.head = null t 阅读全文
posted @ 2020-02-20 15:53 前端之旅 阅读(196) 评论(0) 推荐(0) 编辑
摘要://链表结构 //封装节点 class Node { constructor (data) { this.data = data this.next = null } } class LinkList { constructor () { //初始化,空链表,长度为0 this.head = nul 阅读全文
posted @ 2020-02-20 11:18 前端之旅 阅读(231) 评论(0) 推荐(0) 编辑
摘要:class priorityElement { constructor (elem, priority) { this.elem = elem this.priority = priority } } class priorityQueue { constructor () { this.items 阅读全文
posted @ 2020-02-20 09:09 前端之旅 阅读(140) 评论(0) 推荐(0) 编辑
摘要://队列,先进先出 class Queue { constructor () { this.items = [] } //入队 enQueue (elem) { return this.items.push(elem) } //出队 deQueue () { return this.items.sh 阅读全文
posted @ 2020-02-18 15:17 前端之旅 阅读(187) 评论(0) 推荐(0) 编辑
摘要://队列,先进先出 class Queue { constructor () { this.items = [] } //入队 enqueue (elem) { return this.items.push(this.items) } //出队 dequeue () { return this.it 阅读全文
posted @ 2020-02-18 11:48 前端之旅 阅读(121) 评论(0) 推荐(0) 编辑
摘要://栈, 一种运算受限的线性表,后进先出(LIFO) class Stack { constructor () { this.items = [] } // 进栈 enterStack (elem) { return this.items.push(elem) } // 出栈 outStack () 阅读全文
posted @ 2020-02-18 11:37 前端之旅 阅读(451) 评论(0) 推荐(0) 编辑
摘要://栈, 一种运算受限的线性表,后进先出(LIFO) class Stack { constructor () { this.items = [] } // 进栈 enterStack (elem) { return this.items.push(elem) } // 出栈 outStack () 阅读全文
posted @ 2020-02-18 10:36 前端之旅 阅读(92) 评论(0) 推荐(0) 编辑
摘要:// 数组 let nums = [1,2,3] //字面量 let arr = new Array(0,1,2,3,4,5) //实例Array // 增加 // pusu方法 在数组末尾添加数据 // unshift方法 在数组头部添加数据 nums.push(4) nums.unshift(0 阅读全文
posted @ 2020-02-18 09:47 前端之旅 阅读(328) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示