Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
2024年2月22日 星期四
python C++計算 indegree解Leetcode 997 Find the Town Judge
python C++計算 indegree解Leetcode 997 Find the Town Judge
使用圖形解決方案。
由於信任中的每一對 e=(a, b) 實際上表示一種信任關係,可以將其視為有向邊。C++程式請進
---
2024年2月21日 星期三
python C++ bit 計算O(1)時間解Leetcode 201 Bitwise AND of Numbers Range
python C++ bit 計算O(1)時間解Leetcode 201 Bitwise AND of Numbers Range
這就是用x&(x-1)技法。有人會說計算時間是O(log n),但32-bit整數,無論是迴圈或遞迴頂多32次。如果要熟透bit處理的訣竅,還有更厲害的技法,請進
2024年2月20日 星期二
python C++高斯小學公式與xor sum速解Leetcode 268 Missing Number
python C++高斯小學公式與xor sum速解Leetcode 268 Missing Number
片中講兩種解法,一是用Gauss的n(n+1)/2公式,二是用xor-sum
第三種解法片中未顯示,採radix sort再binary search
2024年2月19日 星期一
#黑柴犬 black shiba草地跟狗朋友玩
‹
›
首頁
查看網路版