일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- DailyLeetCoding
- python3
- LinkedList
- A* Algorithm
- heap
- VCS
- String
- 구현
- Two Pointers
- BFS
- ArrayList vs LinkedList
- sorting
- hash table
- 자료구조
- leetcode
- Leedcode
- Hashtable
- Union Find
- SinglyLinkedList
- greedy
- dfs
- Java
- array
- stack
- Easy
- 광연자동차운전면허학원
- graph
- hash
- Bellman-Ford
- Medium
Archives
- Today
- Total
목록A* Algorithm (1)
Min IT's Devlog
[python3] 1091. Shortest Path in Binary Matrix
풀이 일자: 23.06.01 난이도: [Medium] 분류: [BFS] 문제 내용 내용은 0과 1로 이루어진 배열이 주어졌을 때 (0,0)에서 (n-1,n-1)로 0만 밟으면서 이동할 때 최단 거리를 리턴하는 문제로 이동할 수 있는 범위는 edge와 맞닿아있는 총 8개의 면에 갈 수 있다. 문제 해결 흐름 1. 항상 이러한 배열과 최단거리의 조합은 BFS와 DFS 둘 중 하나를 떠올릴 수 있다. → 나는 BFS를 순회 알고리즘에서 매우 선호하기도 하고 DFS를 사용하기에는 BFS를 사용하는 것보다는 최단거리를 계산하기 부적합하다고 생각하여 BFS를 이용하여 문제를 해결했다. class Solution: def shortestPathBinaryMatrix(self, grid: List[List[int]])..
코테/LeetCode(Solve)
2023. 6. 1. 12:55