- 博客(4)
- 收藏
- 关注
原创 算法-优先级队列
function PriorityQueue() {function QueueElement(e, p) {this.element = ethis.priority = p}this.items = []PriorityQueue.prototype.enqueue = (e, p) => {let ele = new QueueElement(e, p)if (this.items.length === 0) {this.items.push(ele)} else {let
2020-08-26 11:07:21 98
原创 算法-队列-击鼓传花
class Queue {items = []enqueue = (e) => {this.items.push(e)}dequeue = () => {return this.items.shift()}front = () => {return this.items[0]}isEmpty = () => {return this.items.length === 0}size = () => {return this.items.length
2020-08-26 11:05:07 127
原创 算法-栈-十进制转二进制
class Stack { items = [] push = (e) => { this.items.push(e) } pop = () => { return this.items.pop() } peek = () => { return this.items[this.items.length - 1] } isEmpty = () => { return this.items.length === 0 }
2020-08-26 11:02:02 108
原创 es6 Promise 全面讲解、自定义Promise、Promise面试题
es6 Promise 全面讲解、自定义Promise、Promise面试题es6 Promise 全面讲解定义基本用法常见问题自定义PromisePromise面试题
2020-08-26 10:50:06 173 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人