2021-06-19から1日間の記事一覧
class Queue { constructor() { this.front = []; this.back = []; } isEmpty() { return this.front.length == 0 && this.back.length == 0; } push(x) { this.back.push(x); } pop() { if(this.isEmpty()) { return undefined; } if(this.front.length == …