-
Number of Connected Components in an Undirected Graph
Problem https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/ Solution #1. DFS Solution #2. Union Find Read more
-
Graph Valid Tree
Problem https://leetcode.com/problems/graph-valid-tree/description/ Solution #1. DFS Solution #2. Union-Find Solution #3. Union-Find with boolean type Read more
-
Number of Provinces
Problem https://leetcode.com/explore/featured/card/graph/618/disjoint-set/3845/ Solution Read more
-
Disjoint Set (Union-Find)
What is Disjoint Set ? Idea of Union-Find #1. Parent Vertex를 저장하는 배열을 만든다. #2. 각 Edge 를 돌면서 parent vertex를 업데이트한다. (Union) #3. Connectivity 확인 (Find) Quick Find – Improved Idea of Union-Find #1 위에서 서술한 방법에서 조금만 개선하면 더 나은 알고리즘이 될 수 있다. parent vertex 배열을 root vertex 배열로 만들어주는것! 즉, Union Read more
-
Kahn’s Algorithm – Topological Sorting
문제들 중, graph 에서 특정 노드를 방문하기 전에 다른 노드를 반드시 방문해야하는 케이스들이 있다. 예를 들어, 수강하고자 하는 강의는 선수강 강의가 있어서 해당 강의를 먼저 들어야 하는등.. 이런 경우 DFS 를 통해 문제를 푸는것도 가능하지만, Kahn’s Algorithm 을 통해 문제를 풀 수 있다! Algorithm 1. inDegree(=incoming path 갯수) 가 0인 node 들을 queue 에 넣는다. Read more
-
Pacific Atlantic Water Flow
Problem https://leetcode.com/problems/pacific-atlantic-water-flow/description/ Solution Read more
- AI (1)
- Algorithm (96)
- Ideas (26)
- Problems (79)
- Backtracking (12)
- Dynamic Programming (14)
- Greedy (1)
- Queue & Stack (14)
- BFS & DFS (9)
- Recursion (6)
- _Others (33)
- Blockchain (5)
- Database (1)
- DevOps (1)
- Java (40)
- Linux (1)
- Network (1)
- Operating System (2)
- Programming (1)
- Spring (9)
- System Design (24)
- Uncategorized (1)
- Web (2)
Availability (2) Binary Search Tree (2) Consistency (2) Design Doc (1) DFS (3) Durability (2) Dynamic Programming (4) Graph (7) HashMap (3) Linked List (3) List (2) Monotonic (3) MSA (2) Performance (2) Prefix Sum (4) Rate Limiter (3) Replication (2) Scalability (3) Sliding Window (8) System Design (22) Thread (2) Trie (3) Two Pointers (3) Union-Find (6) WebSocket (2) ⭐️ (6) ⭐️⭐️ (4) ⭐️⭐️⭐️ (11) ⭐️⭐️⭐️⭐️ (24) ⭐️⭐️⭐️⭐️⭐️ (41)
