上一页 1 ··· 8 9 10 11 12
摘要: //单向循环链表 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 前端之旅 阅读(311) 评论(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 前端之旅 阅读(203) 评论(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 前端之旅 阅读(237) 评论(0) 推荐(0)
摘要: class priorityElement { constructor (elem, priority) { this.elem = elem this.priority = priority } } class priorityQueue { constructor () { this.items 阅读全文
posted @ 2020-02-20 09:09 前端之旅 阅读(146) 评论(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 前端之旅 阅读(192) 评论(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 前端之旅 阅读(127) 评论(0) 推荐(0)
摘要: //栈, 一种运算受限的线性表,后进先出(LIFO) class Stack { constructor () { this.items = [] } // 进栈 enterStack (elem) { return this.items.push(elem) } // 出栈 outStack () 阅读全文
posted @ 2020-02-18 11:37 前端之旅 阅读(463) 评论(0) 推荐(0)
摘要: //栈, 一种运算受限的线性表,后进先出(LIFO) class Stack { constructor () { this.items = [] } // 进栈 enterStack (elem) { return this.items.push(elem) } // 出栈 outStack () 阅读全文
posted @ 2020-02-18 10:36 前端之旅 阅读(99) 评论(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 前端之旅 阅读(334) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2019-10-15 09:37 前端之旅 阅读(3) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12