Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/douchuan/algorithm
/ functions
Functions
655 in github.com/douchuan/algorithm
⨍
Functions
655
◇
Types & classes
86
Method
from
(nv: usize)
src/graph/shortest/ew_digraph.rs:54
Method
get
(&self, key: &K)
src/tree/binary/bst.rs:42
Method
get
(&self, key: &K)
src/tree/binary/rb2.rs:132
Method
get_e
(&self)
src/graph/util/parser.rs:66
Method
get_entry
(&self)
src/tree/binary/node.rs:289
Function
has_cycle
使用双指针,一个指针每次移动一个节点,一个指针每次移动两个节点, 如果存在环,那么这两个指针一定会相遇。
src/ll/cycle.rs:11
Method
has_cycle
Returns true if the graph G has a cycle.
src/graph/undirected/cycle.rs:36
Method
has_cycle
does G have a directed cycle?
src/graph/directed/cycle.rs:48
Method
has_opportunity
(&self)
src/graph/shortest/arbitrage.rs:30
Method
has_order
Does the digraph have a topological order? true if the digraph has a topological order (or equivalently, if the digraph is a DAG), and false otherwise
src/graph/directed/sort.rs:22
Method
has_path
Is there a path from the vertex s to vertex t?
src/graph/shortest/dijkstra_sp.rs:152
Function
heapify
()
tests/test_common_heap.rs:4
Function
height
()
tests/test_rb_tree2.rs:6
Method
id
component identifier for v ( between 0 and count()-1 )
src/graph/undirected/cc.rs:59
Method
in_degree
(&self, v: usize)
src/graph/shortest/ew_digraph.rs:48
Function
index_max_pq
()
tests/test_common.rs:125
Function
index_min_pq
()
tests/test_common.rs:91
Function
inorder_iter
()
tests/test_tree_traverse.rs:98
Function
inorder_recursive
()
tests/test_tree_traverse.rs:111
Function
insert
()
tests/test_common_heap.rs:76
Method
insert
(&mut self, key: K)
src/common/max_heap.rs:57
Method
insert
(&mut self, key: K, val: V)
src/tree/binary/bst.rs:28
Function
insert1
()
tests/test_rb_tree2.rs:19
Function
insert2
()
tests/test_rb_tree2.rs:32
Function
insert_sort_dth
()
tests/test_sort.rs:42
Method
into_vec
(mut self)
src/common/top_m.rs:28
Function
is23
Does the tree have no red right links, and at most one (left) red links in a row on any path?
src/tree/binary/rb2.rs:402
Function
is_balance
does every path from the root to a leaf have the given number of black links?
src/tree/binary/rb2.rs:358
Method
is_bipartite
(&self)
src/graph/undirected/bipartite.rs:47
Method
is_black
(&self)
src/tree/binary/node.rs:215
Function
is_bst
is the tree rooted at x a BST with all keys strictly between min and max (if min or max is null, treat as empty constraint)
src/tree/binary/bst.rs:262
Function
is_bst
()
tests/test_bst_tree.rs:88
Method
is_empty
Is this symbol table empty
src/strings/tries.rs:70
Method
is_empty
(&self)
src/ll/linked_list.rs:42
Method
is_empty
(&self)
src/common/stack.rs:35
Method
is_empty
Returns true if this priority queue is empty
src/common/priority_queue.rs:65
Method
is_empty
Returns true if this queue is empty
src/common/queue.rs:45
Function
is_palindrome
(word: &str)
src/strings/palindrome.rs:1
Method
iter
(&self)
src/ll/linked_list.rs:91
Method
iter
Returns an iterator that iterates over the items in this queue in FIFO order
src/common/queue.rs:35
Method
iterate
# Safety This is highly unsafe, due to pointer 时间复杂度 O(n), 空间复杂度 O(n)
src/tree/binary/traverse.rs:119
Function
keys
()
tests/test_rb_tree2.rs:108
Method
keys
Returns all keys in the symbol table
src/strings/tries.rs:106
Method
keys
(&self)
src/tree/binary/rb2.rs:187
Method
keys_that_match
Returns all of the keys in the symbol table that match *pattern*, where the character '.' is interpreted as a wildcard character.
src/strings/tries.rs:121
Function
kmp
()
tests/test_strings.rs:353
Function
large_merge_v1
(b: &mut Bencher)
benches/sort.rs:19
Function
large_merge_v2
(b: &mut Bencher)
benches/sort.rs:63
Function
large_merge_v3
(b: &mut Bencher)
benches/sort.rs:107
Function
large_quick
(b: &mut Bencher)
benches/sort.rs:151
Function
large_quick_3way
(b: &mut Bencher)
benches/sort.rs:160
Function
large_selection_sort
(b: &mut Bencher)
benches/sort.rs:212
Function
large_selection_tree_selection
(b: &mut Bencher)
benches/sort.rs:221
Function
large_sorted_asc_merge_v1
(b: &mut Bencher)
benches/sort.rs:28
Function
large_sorted_asc_merge_v2
(b: &mut Bencher)
benches/sort.rs:72
Function
large_sorted_asc_merge_v3
(b: &mut Bencher)
benches/sort.rs:116
Function
large_sorted_asc_quick
(b: &mut Bencher)
benches/sort.rs:169
Function
large_sorted_desc_merge_v1
(b: &mut Bencher)
benches/sort.rs:37
Function
large_sorted_desc_merge_v2
(b: &mut Bencher)
benches/sort.rs:81
Function
large_sorted_desc_merge_v3
(b: &mut Bencher)
benches/sort.rs:125
Function
large_sorted_desc_quick
(b: &mut Bencher)
benches/sort.rs:178
Method
last
(&self)
src/ll/linked_list.rs:104
Function
lazy_Prim_mst
()
tests/test_graph_mst.rs:31
Method
len
(&self)
src/ll/linked_list.rs:38
Method
len
Returns the number of keys on this priority queue
src/common/priority_queue.rs:70
Method
len
Returns the number of items in this queue
src/common/queue.rs:40
Function
levelorder2_iter
()
tests/test_tree_traverse.rs:156
Function
levelorder2_traverse
()
tests/test_tree_traverse.rs:164
Function
levelorder_iter
()
tests/test_tree_traverse.rs:140
Function
levelorder_traverse
()
tests/test_tree_traverse.rs:148
Function
levelorder_zigzag_iter
()
tests/test_tree_traverse.rs:172
Function
levelorder_zigzag_traverse
()
tests/test_tree_traverse.rs:180
Method
lg_r
Returns the binary logarithm of the number of characters in this alphabet
src/strings/alphabet.rs:137
Function
locate_file
()
tests/test_undirected_graph.rs:179
Method
longest_prefix_of
Returns the string in the symbol table that is the longest prefix of query, or None, if no such string.
src/strings/tst.rs:84
Method
longest_prefix_of
Returns the string in the symbol table that is the longest prefix of *query*, or None, if no such string.
src/strings/tries.rs:130
Function
magnitude
()
tests/test_sparse_vec.rs:13
Method
magnitude
Returns the magnitude of this vector. This is also known as the L2 norm or the Euclidean norm.
src/math/sparse_vector.rs:76
Function
main
()
build.rs:3
Function
main
()
examples/quadratic.rs:2
Function
make_changes
()
tests/test_dp.rs:4
Function
make_changes_classic
(b: &mut Bencher)
benches/dp.rs:10
Function
make_changes_fail
()
tests/test_dp.rs:26
Function
make_changes_iter
(b: &mut Bencher)
benches/dp.rs:16
Method
marked
(&self, v: usize)
src/graph/undirected/dfs2.rs:24
Method
marked
is v connected to s?
src/graph/undirected/dfs.rs:33
Method
max_degree
compute maximum degree
src/graph/undirected/graph.rs:79
Function
max_pq
()
tests/test_common.rs:71
Function
merge
()
tests/test_sort.rs:72
Function
mfv1
最小可用ID 这道题目来自 Richard Bird 书中的第一章 [1]。 现代社会中,有很多服务依赖一种被称为ID的概念。 例如身份证就是一种ID,银行账户也是一种ID,电 话号码本质上也是一种ID。假设我们使用非负整数作 为某个系统的的ID,所有用户都由一个ID唯一确定。 任何时间,这个系统
src/other/min_free.rs:19
Function
min_max
()
tests/test_rb_tree2.rs:98
Function
min_pq
()
tests/test_common.rs:51
Method
minimal
()
src/tree/binary/builder/tournament.rs:31
Method
morris
# Safety This is highly unsafe, due to pointer 时间复杂度 O(n), 空间复杂度 O(1) 大概思路:当一个node有left subtree时,需要遍历left subtree 的各节点,完成left subtree的遍历,需要回溯到node,
src/tree/binary/traverse.rs:151
Method
new
(c: usize)
src/strings/tst.rs:248
Method
new
(val: Option<T>)
src/strings/tries.rs:287
Method
new
(element: T)
src/ll/linked_list.rs:11
Method
new
(mut keys: Vec<K>)
src/common/max_heap.rs:25
Method
new
(n: usize)
src/common/uf.rs:88
Method
new
(cap: usize, comparator: Comparator<T>)
src/common/priority_queue.rs:51
← previous
next →
401–500 of 655, ranked by callers