Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
2024年4月24日 星期三
C++ UnionFind BFS DFS解圖論問題Leetcode 1971 Find if Path Exists in Graph
C++ UnionFind BFS DFS解圖論問題Leetcode 1971 Find if Path Exists in Graph
使用UnionFind class實作容易,效能又好,這對無向圖特別有效。
為了比較,BFS、DFS也實作
Python C++速解Leetcode 1137 N th Tribonacci Number
Python CPP速解Leetcode 1137 N th Tribonacci Number
先用遞迴、再加上cache,然後轉成動態規劃,當然還可以用矩陣冪次方
‹
›
首頁
查看網路版