단일연결리스트1 [JS] 연결리스트 Linked list 추상적 자료형인 리스트를 구현한 자료구조로, Linked List 라는 말 그대로 어떤 데이터 덩어리를 저장할 때 그 다음 순서의 자료가 있는 위치를 데이터에 포함시키는 방식으로 자료를 저장. 단일 연결리스트 Singly Linked Lists class Node { constructor(val) { this.val = val; this.next = null; } } class SinglyLinkedList { constructor() { this.head = null; this.tail = null; this.length = 0; } push(val) { //새로운 노드 생성 let newNode = new Node(val); //현재 연결리스트에 head가 비어있다면 if (!this.head) { .. 2022. 12. 16. 이전 1 다음