DanKim0213 / Today-I-Learned

Today I Learned
1 stars 0 forks source link

Introduction to Algorithms #20

Open DanKim0213 opened 1 year ago

DanKim0213 commented 1 year ago

Introduction to Algorithms

DanKim0213 commented 1 year ago

BFS vs DFS

Some coding problems must be solved by BFS or DFS, not both. Which algorithm is decided by the coding problems' features.

TL;DR; BFS doesn't need to go back while DFS needs to since DFS is dependent on your past decisions.

BFS

숨바꼭질, 아기상어, 캐슬디펜스, 토마토

DFS

감시, 빵집

DanKim0213 commented 10 months ago

Disjoint Set vs Topological Sorting

Disjoint Set:

공항 (10775)

4 // G 6 // P 2 // 2 -> 1 2 // 2 -> 1 -> 0 3 // 3 -> 2 3 // 쭈욱 부모를 따라가보니 0이네? 리턴 4 4

따라서 3

DanKim0213 commented 10 months ago

Two pointers vs Sliding window vs Prefix sum

투-포인터-슬라이딩-윈도우-구간-합-알고리즘

DanKim0213 commented 10 months ago

Binary Search vs Parametric Search

Binary Search vs Parametric Search