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
↓ 4 callers
Method
put
Sets the ith coordinate of this vector to the specified value.
src/math/sparse_vector.rs:28
↓ 4 callers
Method
reverse
reverse of this digraph
src/graph/directed/digraph.rs:33
↓ 4 callers
Function
rotate_left
左旋操作变换为: X Y / \ / \ a Y => X c / \ /
src/tree/binary/rb.rs:204
↓ 4 callers
Method
set_children
(&mut self, l: Option<NonNull<Node<K, V>>>, r: Option<NonNull<Node<K, V>>>)
src/tree/binary/node.rs:160
↓ 4 callers
Function
vec_alphabet
n, item length n = 1, vec!["a", "b", ... "z"] n = 2, vec!["aa", "bb", ... "zz"]
src/common/util.rs:12
↓ 4 callers
Method
weight
Returns the sum of the edge weights in a minimum spanning tree (or forest)
src/graph/mst/prim_mst.rs:48
↓ 3 callers
Method
G
(&self)
src/graph/util/symbol_graph.rs:63
↓ 3 callers
Method
contains
(&self, key: &K)
src/tree/binary/rb2.rs:175
↓ 3 callers
Function
create_ll
(data: &[T])
tests/test_linked_list.rs:111
↓ 3 callers
Method
cycle
vertices on a cycle (if one exists)
src/graph/directed/cycle.rs:53
↓ 3 callers
Function
do_build
构建锦标赛树, from bottom to top a中不能包含T::minimal()这个特殊值,pop需要用到T::minimal()做临界值
src/tree/binary/builder/tournament.rs:95
↓ 3 callers
Method
exch
(&mut self, i: usize, j: usize)
src/common/priority_queue.rs:253
↓ 3 callers
Function
find
(l: &LinkedList<T>, k: usize)
src/ll/kth2tail.rs:9
↓ 3 callers
Function
find_max
# Safety This is highly unsafe, due to pointer
src/tree/binary/bst.rs:132
↓ 3 callers
Method
first
(&self)
src/ll/linked_list.rs:100
↓ 3 callers
Method
flip_color
(&mut self)
src/tree/binary/node.rs:201
↓ 3 callers
Function
heapify
(keys: &mut [K], mut i: usize)
src/common/max_heap.rs:69
↓ 3 callers
Method
i_am_left
(&self)
src/tree/binary/node.rs:231
↓ 3 callers
Method
index
index associated with key
src/graph/util/symbol_graph.rs:52
↓ 3 callers
Function
left
(i: usize)
src/common/binary_tree.rs:7
↓ 3 callers
Method
left_key
(&self)
src/tree/binary/node.rs:277
↓ 3 callers
Method
max
(&self)
src/tree/binary/bst.rs:50
↓ 3 callers
Function
parse_list_float
(i: &str)
src/graph/util/parser.rs:104
↓ 3 callers
Function
preorder_test_data
()
tests/test_tree_traverse.rs:187
↓ 3 callers
Function
rotate_right
右旋操作变换为: Y X / \ / \ X c => a Y / \ / \ a
src/tree/binary/rb.rs:233
↓ 3 callers
Method
scan
(&mut self, g: &dyn IEWGraph, v: usize)
src/graph/mst/lazy_prim_mst.rs:68
↓ 3 callers
Method
set
(&mut self, i: usize, key: K)
src/common/max_heap.rs:47
↓ 3 callers
Function
sort_desc
排序结果:大 -> 小 构建tree的时间复杂度 O(n) 每次pop的时间复杂度 O(log2(n)),所以弹出n个元素的的时间复杂度为 O(n * log2(n))
src/sort/tree_selection.rs:15
↓ 3 callers
Method
swim
(&mut self, mut k: usize)
src/common/priority_queue.rs:100
↓ 3 callers
Method
to_chars
Returns the characters corresponding to the argument indices
src/strings/alphabet.rs:116
↓ 3 callers
Method
to_indices
Returns the indices corresponding to the argument characters
src/strings/alphabet.rs:103
↓ 3 callers
Method
weight
(&self)
src/graph/mst/kruskal_mst.rs:99
↓ 3 callers
Method
weight
(&self)
src/graph/mst/lazy_prim_mst.rs:39
↓ 2 callers
Method
V
(&self)
src/graph/directed/digraph.rs:13
↓ 2 callers
Method
add
(self, rhs: Self)
src/math/sparse_vector.rs:93
↓ 2 callers
Method
add_edge
(&mut self, v: usize, w: usize)
src/graph/undirected/graph.rs:58
↓ 2 callers
Method
add_edge
(&mut self, v: usize, w: usize)
src/graph/directed/digraph.rs:21
↓ 2 callers
Function
build_heap
(keys: &mut [K])
src/common/max_heap.rs:100
↓ 2 callers
Function
collect_prefix
( x: Option<NonNull<Node<T>>>, prefix: &mut String, results: &mut Queue<String>, )
src/strings/tst.rs:177
↓ 2 callers
Method
contains
Does this symbol table contain the given key?
src/strings/tst.rs:27
↓ 2 callers
Method
contains
Is i an index on this priority queue?
src/common/priority_queue.rs:160
↓ 2 callers
Method
contains
is key a vertex?
src/graph/util/symbol_graph.rs:47
↓ 2 callers
Method
copy_entry
(&mut self, src: NonNull<Node<K, V>>)
src/tree/binary/node.rs:192
↓ 2 callers
Method
decrease_key
(&mut self, i: usize, key: T)
src/common/priority_queue.rs:208
↓ 2 callers
Function
del_min
delete the min element rooted at h
src/tree/binary/rb2.rs:220
↓ 2 callers
Method
delete
(&mut self, key: &K)
src/tree/binary/rb2.rs:162
↓ 2 callers
Method
dfs
(&mut self, graph: &dyn IGraph, v: usize)
src/graph/directed/search.rs:37
↓ 2 callers
Method
dist_to
Returns the length of a shortest path from the source vertex s to vertex v
src/graph/shortest/dijkstra_sp.rs:64
↓ 2 callers
Method
edges
(&self)
src/graph/shortest/ew_digraph.rs:34
↓ 2 callers
Function
get_dth
return subtrie corresponding to given key
src/strings/tst.rs:123
↓ 2 callers
Function
get_dth
(x: Option<NonNull<Node<T>>>, key: &str, d: usize)
src/strings/tries.rs:197
↓ 2 callers
Method
get_edges
(&self)
src/graph/util/parser.rs:70
↓ 2 callers
Method
get_weighted_edges
(&self)
src/graph/util/parser.rs:74
↓ 2 callers
Method
has_negative_cycle
Is there a negative cycle reachable from the source vertex s?
src/graph/shortest/bellman_ford_sp.rs:94
↓ 2 callers
Method
has_path
(&self, v: usize)
src/graph/util/paths.rs:40
↓ 2 callers
Method
has_path_to
Is there a path from the source vertex s to vertex v?
src/graph/shortest/acyclic_sp.rs:55
↓ 2 callers
Function
heap_fix
与heapify的区别: heapify 是从i节点开始,调整子树 (向下调整) heap_fix 是从i节点开始,调整父节点(向上调整)
src/common/max_heap.rs:120
↓ 2 callers
Function
inorder_test_data
()
tests/test_tree_traverse.rs:205
↓ 2 callers
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/tst.rs:114
↓ 2 callers
Method
keys_with_prefix
Returns all of the keys in the set that start with prefix.
src/strings/tst.rs:65
↓ 2 callers
Function
merge
(mut l: &[T], mut r: &[T])
src/sort/merge.rs:30
↓ 2 callers
Function
move_red_left
Assuming that h is red and both h.left and h.left.left are black, make h.left or one of its children red.
src/tree/binary/rb2.rs:377
↓ 2 callers
Function
move_red_right
Assuming that h is red and both h.right and h.right.left are black, make h.right or one of its children red.
src/tree/binary/rb2.rs:390
↓ 2 callers
Method
name
key associated with index v
src/graph/util/symbol_graph.rs:57
↓ 2 callers
Method
nnz
Returns the number of nonzero entries in this vector.
src/math/sparse_vector.rs:42
↓ 2 callers
Method
order
Returns a topological order if the digraph has a topologial order, and None otherwise.
src/graph/directed/sort.rs:28
↓ 2 callers
Method
parse
(s: &str, is_weighted: bool)
src/graph/util/parser.rs:19
↓ 2 callers
Function
parse_list_str
用sep分割的字符串
src/graph/util/parser.rs:110
↓ 2 callers
Function
parse_num
(i: &str)
src/graph/util/parser.rs:79
↓ 2 callers
Method
partial_cmp
(&self, other: &Self)
src/graph/mst/edge.rs:39
↓ 2 callers
Method
peek_key
MinPQ: Returns a minimum key MaxPQ: Returns a maximum key
src/common/priority_queue.rs:172
↓ 2 callers
Method
pred
(&self, key: &K)
src/tree/binary/bst.rs:58
↓ 2 callers
Method
relax
(&mut self, e: &DirectedEdge)
src/graph/shortest/acyclic_sp.rs:75
↓ 2 callers
Method
replace
(&mut self, node: Option<NonNull<Node<K, V>>>)
src/tree/binary/node.rs:165
↓ 2 callers
Function
right
(i: usize)
src/common/binary_tree.rs:13
↓ 2 callers
Method
right_key
(&self)
src/tree/binary/node.rs:281
↓ 2 callers
Function
rotate_left
h x / \ / \ A R(x) => R(h) C / \ / \ B
src/tree/binary/rb2.rs:305
↓ 2 callers
Method
sink
(&mut self, mut k: usize)
src/common/priority_queue.rs:107
↓ 2 callers
Function
substr_data
()
tests/test_strings.rs:375
↓ 2 callers
Method
succ
(&self, key: &K)
src/tree/binary/bst.rs:54
↓ 2 callers
Method
to_index
Returns the index corresponding to the argument character
src/strings/alphabet.rs:98
↓ 2 callers
Method
uncle
(node: Option<NonNull<Self>>)
src/tree/binary/node.rs:103
↓ 2 callers
Function
wmerge
merge two sorted subs xs[i, m) and xs[j...n) to working area xs[w...]
src/sort/merge.rs:137
↓ 2 callers
Function
wsort
sort xs[l, u), and put result to working area w. constraint, len(w) == u - l
src/sort/merge.rs:167
↓ 1 callers
Method
E
(&self)
src/graph/mst/ew_graph.rs:30
↓ 1 callers
Method
E
(&self)
src/graph/undirected/graph.rs:54
↓ 1 callers
Method
add_edge
(&mut self, v: usize, w: usize, weight: f32)
src/graph/mst/ew_graph.rs:34
↓ 1 callers
Method
bfs
(&mut self, g: &dyn IGraph, s: usize)
src/graph/util/paths.rs:126
↓ 1 callers
Function
branch
创建分支节点,取t1, t2较大者的value构造parent
src/tree/binary/builder/tournament.rs:118
↓ 1 callers
Function
build
?? why K: std::str::FromStr
src/tree/binary/builder/level.rs:26
↓ 1 callers
Function
calc_blacks
(x: Option<NonNull<Node<K, V>>>)
src/tree/binary/rb2.rs:416
↓ 1 callers
Function
calc_size
Returns the number of key-value pairs
src/tree/binary/bst.rs:278
↓ 1 callers
Function
collect_match
( x: Option<NonNull<Node<T>>>, prefix: &mut String, i: usize, pattern: &str, results: &mut
src/strings/tst.rs:196
↓ 1 callers
Function
collect_match
( x: Option<NonNull<Node<T>>>, prefix: &mut String, pattern: &str, results: &mut Queue<String>
src/strings/tries.rs:226
↓ 1 callers
Function
collect_prefix
( x: Option<NonNull<Node<T>>>, prefix: &mut String, results: &mut Queue<String>, )
src/strings/tries.rs:209
↓ 1 callers
Function
counter
(h: Option<NonNull<Node<K, V>>>, mut black: usize)
src/tree/binary/rb2.rs:359
↓ 1 callers
Method
degree
compute the degree of v
src/graph/undirected/graph.rs:74
↓ 1 callers
Function
del_max
delete the max element rooted at h
src/tree/binary/rb2.rs:239
↓ 1 callers
Function
delete
# Safety This is highly unsafe, due to pointer 从二叉搜索树中删除节点 x 的方法如下: 如果 x 没有子节点,或者只有一个孩子,直接将 x“切下”; 否则,x 有两个孩子,我们用其右子树中的最小值替换掉 x,然后将右子树中的这一最小值“切掉”。
src/tree/binary/bst.rs:207
↓ 1 callers
Function
delete
(h: Option<NonNull<Node<K, V>>>, key: &K)
src/tree/binary/rb2.rs:261
← previous
next →
101–200 of 655, ranked by callers