꼬비.com

  • 홈
  • 생각정리

2022/09/24 2

BFS(Breadth First Search) & DFS(Depth First Search)

BFS /** * 2 ways of traversing a tree. * - Breadth First Search (BFS) * - Depth First Search (DFS) * * BFS (Steps - Iteratively) * - Create a queue(this can be an array) and a variable to store the values of nodes visited. * - Place the root node in the queue. * - Loop as long as there is anything in the queue. * > Dequeue a node from the queue and push the value of the node into the variable th..

Algorithm 2022.09.24

BST (Binary Search Tree)

/** * Kind of Tree * * - Trees * - Binary Trees * - Binary Search Trees * - ... * */ /** * Binary Serach Trees (BSTS) * * - Every parent node has at most 2 child. * - Every node to the left of a parent node is always less than the parent. * - Every node to the right of a parent node is always greater than the parent. * */ class Node { constructor(value) { this.value = value; this.left = null; th..

Algorithm 2022.09.24
이전
1
다음
더보기
프로필사진

평범한 개발 블로그입니다.

  • 분류 전체보기 (92)
    • 생각정리 (5)
    • Architecture (3)
    • Algorithm (43)
    • Blockchain (4)
    • DB (6)
    • DevOps (5)
    • Network (2)
    • 개발 이슈 (10)
    • 컬럼 (2)
    • 도서 & 강의 (3)
    • 일상 (3)
    • 기타 (6)

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2022/09   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바