摘要: 1、定义一个栈的类 class Stack{ constructor(){ this.items=[] } // 从栈顶添加元素 push(ele){ this.items.push(ele) } // 从栈移除元素 pop(){ return this.items.pop() } // 查看栈顶元 阅读全文
posted @ 2022-01-12 17:18 she_will 阅读(194) 评论(0) 推荐(0) 编辑