C++ DFS BFS貪婪三法解Leetcode農地問題1992 Find All Groups of Farmland
------
C++ DFS, BFS & greedy three methods to solve Leetcode farmland problem 1992 Find All Groups of Farmland
Three methods are used to solve the problem, one is DFS, and the other is BFS. The first two methods are very standard. Since farmland is all rectangular, the third method uses greedy calculation to find the right-bottom corner of the rectangle, which is simple and fast.
[codes on Leetcode]https://leetcode.com/problems/find-all-groups-of-farmland/solutions/5047793/dfs-bfs-vs-find-rectangle-corner-74ms-beats-99-64/
[Tree & Graph Playlist]https://www.youtube.com/watch?v=9Lx7yr-tmfI&list=PLYRlUBnWnd5Kt0-3un43cwY6yT_il8NWe
沒有留言:
張貼留言