Linked list

    javascript로 linked list 만들기 (느낌대로)

    javascript로 linked list 만들기 (느낌대로)

    Linked List on Javascript class Node, class LinkedList 를 만들고 push, pop, printall, size 함수를 만든다아래는 코드 전문이다. class Node { constructor(data) { this.data = data; this.next = null; } } class LinkedList { constructor() { this.root = null; this.curNode = null; this.size = 0; } push(data) { const node = new Node(data); if (this.root == null) { this.root = node; this.curNode = node; } else { this.curNode..