분류 전체보기

·네트워크
OSI 7 계층네트워크에서 일어나는 일련의 통신 과정을 계층으로 나타낸것물리계층전기신호를 0과 1 혹은 0과 1을 전기신호로 바꿔주는 행위가 물리계층에서 일어난다.랜카드 : 전기신호를 0과 1 혹은 0과 1을 전기신호로 바꿔주는 역할데이터 링크 계층0101110100110011100과 같이 구성된 데이터가 누구한테 가는지 정해진다. MAC주소 : 한자리씩 4bit 총 48bit로 구성된 기기의 주소 (= 랜카드 ID) Q: 출발지의 MAC주소는 내기기니까 알 수있는데 목적지의 MAC주소는 어떻게 알아낼까?A: 옆에 장치에게 물어보고 또 옆에 장치에게 물어보고 해서 알아낸다.  스위치 또는 허브를 통해 목적지에 해당하는 기기에 도착한다. 프레임 : 데이터링크에서 전송 및 받은 데이터를 의미한다.프로토콜 :..
·자료구조
BFS(Breath First Search) 같은 레벨 먼저 명시 A-B-C-D-E-F순 출력 큐(queue)사용 DFS(Depth First Search) 자기 자식 먼저 명시 A-B-D-E-C-F순 출력 스택(stack)사용 Tree traversal(트리 순회) tree traversal 란 순서대로 트리를 돌면서 무언가를 뽑아내는 것을 의미한다. Pre : 노드 왼쪽면을 지나갈 때에 해당하는 노드 In: 노드 아래면을 지나갈 때에 해당하는 노드 Post: 노드 오른쪽을 지나갈 때에 해당하는 노드 import { BinarySearchTree } from './binarySearchTree.js'; import { Queue } from './queue.js'; import { Stack } fro..
·자료구조
//나보다 작은애들이 왼쪽 나보다 큰애들이 오른쪽 class BinarySearchTree { root = null; length = 0; #insert(node,value){ if(node.value > value){ // 루트 노드보다 작으면 if(node.left){ if(node.left.value === value){ console.log(`${value}값은 이미 존재하는 값입니다.`) return } this.#insert(node.left, value); }else{ node.left = new Node(value); this.length++; } }else{ // 루트 노드보다 크면 if(node.right){ if(node.right.value === value){ console.log..
·자료구조
class Stack { top = null; length = 0; push(value){ const newNode = new Node(value); //new Node 생성 후 할당 newNode.next = this.top; //new Node의 next는 현재 top this.top = newNode; //top을 new Node로 재할당 this.length++; return this.length; } pop(){ if(!this.top){ return null; } this.top = this.top.next; //top은 현재 top의 next this.length--; return this.length; } top(){ return this.top.value; } } class Node{ n..
·자료구조
class Queue { head = null; tail = null; length = 0; //head는 enqueue(value){ const newNode = new Node(value); if(this.head){ //헤드가 있을 때 this.tail.next = newNode; //tail, head 모두 같은 노드를 참조하므로 head의 next에도 newNode가 추가 this.tail = newNode; //tail은 마지막 노드를 보도록 재할당 }else{ //헤드가 없을때 this.tail = newNode; //tail,head 같은 노드를 참조 하도록 newNode할당 this.head = newNode; //tail,head 같은 노드를 참조 하도록 newNode할당 } this...
·자료구조
class LinkedList { head = null; length = 0; add(value){ if(this.head){ //head가 있을때 let current = this.head; while(current.next){ //while문으로 next가 있을 때까지 head를 이동 current = current.next; } current.next = new Node(value); }else{ //head가 없을때 this.head = new Node(value); } this.length ++; return this.length; } #search(index){ let cnt = 0; let prev; let current = this.head; while(cnt < index){ prev =..
king_hd
'분류 전체보기' 카테고리의 글 목록 (3 Page)