1. 스택const stack = [];stack.push(3);stack.push(2);stack.pop();console.log(stack.reverse()); // [2, 3] push(), pop() 메소드로 구현할 수 있다. 2. 큐push(), shift() (맨 앞에 있는 요소 추출) 를 사용하여 구현할 수 있지만, shift()는 O(n)의 시간복잡도를 가지고 있다. 시간상 이점을 가져오고 싶다면 연결 리스트로 큐를 만든다.class Node { constructor(data) { this.data = data; this.next = null; }}class Queue { constructor() { this.front = null; ..