A1go

39/52ページ

BFS and DFS

BFS 和 DFS 為用以在 tree 中搜尋特定 node 的演算法 Breadth-First Search 廣度優先搜尋 Depth-First Search 深度優先搜尋 相關文章:Binary Tree 二元樹   Iterative Implementation BFS:使用 Queue Template queue = collections.deque([root]) w ...

         続きを読む

Leetcode # 242. Valid Anagram

https://leetcode.com/problems/valid-anagram/ Solution Time Complexity: O(max(len(s), len(t))) Space Complexity: O(max(len(s), len(t))) (The input and output generally do not count towards the space co ...

         続きを読む

Leetcode # 409. Longest Palindrome

https://leetcode.com/problems/longest-palindrome/ Solution Palindrome: 回文 Time Complexity: O(len(s)) Space Complexity: O(1) (The input and output generally do not count towards the space complexity.) ...

         続きを読む

arg min / arg max

$$ \mathop{arg\_min}\limits_{x \in S} := \{ x \in S : f(s) \geq f(x) \text{for all } s \in S \} $$ $$ \mathop{arg\_max}\limits_{x \in S} := \{ x \in S : f(s) \leq f(x) \text{for all } s \in S \} $$

         続きを読む
1 ... 39 ... 52
Bitnami