MCPcopy Create free account

hub / github.com/douchuan/algorithm / functions

Functions655 in github.com/douchuan/algorithm

↓ 4 callersMethodput
Sets the ith coordinate of this vector to the specified value.
src/math/sparse_vector.rs:28
↓ 4 callersMethodreverse
reverse of this digraph
src/graph/directed/digraph.rs:33
↓ 4 callersFunctionrotate_left
左旋操作变换为: X Y / \ / \ a Y => X c / \ /
src/tree/binary/rb.rs:204
↓ 4 callersMethodset_children
(&mut self, l: Option<NonNull<Node<K, V>>>, r: Option<NonNull<Node<K, V>>>)
src/tree/binary/node.rs:160
↓ 4 callersFunctionvec_alphabet
n, item length n = 1, vec!["a", "b", ... "z"] n = 2, vec!["aa", "bb", ... "zz"]
src/common/util.rs:12
↓ 4 callersMethodweight
Returns the sum of the edge weights in a minimum spanning tree (or forest)
src/graph/mst/prim_mst.rs:48
↓ 3 callersMethodG
(&self)
src/graph/util/symbol_graph.rs:63
↓ 3 callersMethodcontains
(&self, key: &K)
src/tree/binary/rb2.rs:175
↓ 3 callersFunctioncreate_ll
(data: &[T])
tests/test_linked_list.rs:111
↓ 3 callersMethodcycle
vertices on a cycle (if one exists)
src/graph/directed/cycle.rs:53
↓ 3 callersFunctiondo_build
构建锦标赛树, from bottom to top a中不能包含T::minimal()这个特殊值,pop需要用到T::minimal()做临界值
src/tree/binary/builder/tournament.rs:95
↓ 3 callersMethodexch
(&mut self, i: usize, j: usize)
src/common/priority_queue.rs:253
↓ 3 callersFunctionfind
(l: &LinkedList<T>, k: usize)
src/ll/kth2tail.rs:9
↓ 3 callersFunctionfind_max
# Safety This is highly unsafe, due to pointer
src/tree/binary/bst.rs:132
↓ 3 callersMethodfirst
(&self)
src/ll/linked_list.rs:100
↓ 3 callersMethodflip_color
(&mut self)
src/tree/binary/node.rs:201
↓ 3 callersFunctionheapify
(keys: &mut [K], mut i: usize)
src/common/max_heap.rs:69
↓ 3 callersMethodi_am_left
(&self)
src/tree/binary/node.rs:231
↓ 3 callersMethodindex
index associated with key
src/graph/util/symbol_graph.rs:52
↓ 3 callersFunctionleft
(i: usize)
src/common/binary_tree.rs:7
↓ 3 callersMethodleft_key
(&self)
src/tree/binary/node.rs:277
↓ 3 callersMethodmax
(&self)
src/tree/binary/bst.rs:50
↓ 3 callersFunctionparse_list_float
(i: &str)
src/graph/util/parser.rs:104
↓ 3 callersFunctionpreorder_test_data
()
tests/test_tree_traverse.rs:187
↓ 3 callersFunctionrotate_right
右旋操作变换为: Y X / \ / \ X c => a Y / \ / \ a
src/tree/binary/rb.rs:233
↓ 3 callersMethodscan
(&mut self, g: &dyn IEWGraph, v: usize)
src/graph/mst/lazy_prim_mst.rs:68
↓ 3 callersMethodset
(&mut self, i: usize, key: K)
src/common/max_heap.rs:47
↓ 3 callersFunctionsort_desc
排序结果:大 -> 小 构建tree的时间复杂度 O(n) 每次pop的时间复杂度 O(log2(n)),所以弹出n个元素的的时间复杂度为 O(n * log2(n))
src/sort/tree_selection.rs:15
↓ 3 callersMethodswim
(&mut self, mut k: usize)
src/common/priority_queue.rs:100
↓ 3 callersMethodto_chars
Returns the characters corresponding to the argument indices
src/strings/alphabet.rs:116
↓ 3 callersMethodto_indices
Returns the indices corresponding to the argument characters
src/strings/alphabet.rs:103
↓ 3 callersMethodweight
(&self)
src/graph/mst/kruskal_mst.rs:99
↓ 3 callersMethodweight
(&self)
src/graph/mst/lazy_prim_mst.rs:39
↓ 2 callersMethodV
(&self)
src/graph/directed/digraph.rs:13
↓ 2 callersMethodadd
(self, rhs: Self)
src/math/sparse_vector.rs:93
↓ 2 callersMethodadd_edge
(&mut self, v: usize, w: usize)
src/graph/undirected/graph.rs:58
↓ 2 callersMethodadd_edge
(&mut self, v: usize, w: usize)
src/graph/directed/digraph.rs:21
↓ 2 callersFunctionbuild_heap
(keys: &mut [K])
src/common/max_heap.rs:100
↓ 2 callersFunctioncollect_prefix
( x: Option<NonNull<Node<T>>>, prefix: &mut String, results: &mut Queue<String>, )
src/strings/tst.rs:177
↓ 2 callersMethodcontains
Does this symbol table contain the given key?
src/strings/tst.rs:27
↓ 2 callersMethodcontains
Is i an index on this priority queue?
src/common/priority_queue.rs:160
↓ 2 callersMethodcontains
is key a vertex?
src/graph/util/symbol_graph.rs:47
↓ 2 callersMethodcopy_entry
(&mut self, src: NonNull<Node<K, V>>)
src/tree/binary/node.rs:192
↓ 2 callersMethoddecrease_key
(&mut self, i: usize, key: T)
src/common/priority_queue.rs:208
↓ 2 callersFunctiondel_min
delete the min element rooted at h
src/tree/binary/rb2.rs:220
↓ 2 callersMethoddelete
(&mut self, key: &K)
src/tree/binary/rb2.rs:162
↓ 2 callersMethoddfs
(&mut self, graph: &dyn IGraph, v: usize)
src/graph/directed/search.rs:37
↓ 2 callersMethoddist_to
Returns the length of a shortest path from the source vertex s to vertex v
src/graph/shortest/dijkstra_sp.rs:64
↓ 2 callersMethodedges
(&self)
src/graph/shortest/ew_digraph.rs:34
↓ 2 callersFunctionget_dth
return subtrie corresponding to given key
src/strings/tst.rs:123
↓ 2 callersFunctionget_dth
(x: Option<NonNull<Node<T>>>, key: &str, d: usize)
src/strings/tries.rs:197
↓ 2 callersMethodget_edges
(&self)
src/graph/util/parser.rs:70
↓ 2 callersMethodget_weighted_edges
(&self)
src/graph/util/parser.rs:74
↓ 2 callersMethodhas_negative_cycle
Is there a negative cycle reachable from the source vertex s?
src/graph/shortest/bellman_ford_sp.rs:94
↓ 2 callersMethodhas_path
(&self, v: usize)
src/graph/util/paths.rs:40
↓ 2 callersMethodhas_path_to
Is there a path from the source vertex s to vertex v?
src/graph/shortest/acyclic_sp.rs:55
↓ 2 callersFunctionheap_fix
与heapify的区别: heapify 是从i节点开始,调整子树 (向下调整) heap_fix 是从i节点开始,调整父节点(向上调整)
src/common/max_heap.rs:120
↓ 2 callersFunctioninorder_test_data
()
tests/test_tree_traverse.rs:205
↓ 2 callersMethodkeys_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 callersMethodkeys_with_prefix
Returns all of the keys in the set that start with prefix.
src/strings/tst.rs:65
↓ 2 callersFunctionmerge
(mut l: &[T], mut r: &[T])
src/sort/merge.rs:30
↓ 2 callersFunctionmove_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 callersFunctionmove_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 callersMethodname
key associated with index v
src/graph/util/symbol_graph.rs:57
↓ 2 callersMethodnnz
Returns the number of nonzero entries in this vector.
src/math/sparse_vector.rs:42
↓ 2 callersMethodorder
Returns a topological order if the digraph has a topologial order, and None otherwise.
src/graph/directed/sort.rs:28
↓ 2 callersMethodparse
(s: &str, is_weighted: bool)
src/graph/util/parser.rs:19
↓ 2 callersFunctionparse_list_str
用sep分割的字符串
src/graph/util/parser.rs:110
↓ 2 callersFunctionparse_num
(i: &str)
src/graph/util/parser.rs:79
↓ 2 callersMethodpartial_cmp
(&self, other: &Self)
src/graph/mst/edge.rs:39
↓ 2 callersMethodpeek_key
MinPQ: Returns a minimum key MaxPQ: Returns a maximum key
src/common/priority_queue.rs:172
↓ 2 callersMethodpred
(&self, key: &K)
src/tree/binary/bst.rs:58
↓ 2 callersMethodrelax
(&mut self, e: &DirectedEdge)
src/graph/shortest/acyclic_sp.rs:75
↓ 2 callersMethodreplace
(&mut self, node: Option<NonNull<Node<K, V>>>)
src/tree/binary/node.rs:165
↓ 2 callersFunctionright
(i: usize)
src/common/binary_tree.rs:13
↓ 2 callersMethodright_key
(&self)
src/tree/binary/node.rs:281
↓ 2 callersFunctionrotate_left
h x / \ / \ A R(x) => R(h) C / \ / \ B
src/tree/binary/rb2.rs:305
↓ 2 callersMethodsink
(&mut self, mut k: usize)
src/common/priority_queue.rs:107
↓ 2 callersFunctionsubstr_data
()
tests/test_strings.rs:375
↓ 2 callersMethodsucc
(&self, key: &K)
src/tree/binary/bst.rs:54
↓ 2 callersMethodto_index
Returns the index corresponding to the argument character
src/strings/alphabet.rs:98
↓ 2 callersMethoduncle
(node: Option<NonNull<Self>>)
src/tree/binary/node.rs:103
↓ 2 callersFunctionwmerge
merge two sorted subs xs[i, m) and xs[j...n) to working area xs[w...]
src/sort/merge.rs:137
↓ 2 callersFunctionwsort
sort xs[l, u), and put result to working area w. constraint, len(w) == u - l
src/sort/merge.rs:167
↓ 1 callersMethodE
(&self)
src/graph/mst/ew_graph.rs:30
↓ 1 callersMethodE
(&self)
src/graph/undirected/graph.rs:54
↓ 1 callersMethodadd_edge
(&mut self, v: usize, w: usize, weight: f32)
src/graph/mst/ew_graph.rs:34
↓ 1 callersMethodbfs
(&mut self, g: &dyn IGraph, s: usize)
src/graph/util/paths.rs:126
↓ 1 callersFunctionbranch
创建分支节点,取t1, t2较大者的value构造parent
src/tree/binary/builder/tournament.rs:118
↓ 1 callersFunctionbuild
?? why K: std::str::FromStr
src/tree/binary/builder/level.rs:26
↓ 1 callersFunctioncalc_blacks
(x: Option<NonNull<Node<K, V>>>)
src/tree/binary/rb2.rs:416
↓ 1 callersFunctioncalc_size
Returns the number of key-value pairs
src/tree/binary/bst.rs:278
↓ 1 callersFunctioncollect_match
( x: Option<NonNull<Node<T>>>, prefix: &mut String, i: usize, pattern: &str, results: &mut
src/strings/tst.rs:196
↓ 1 callersFunctioncollect_match
( x: Option<NonNull<Node<T>>>, prefix: &mut String, pattern: &str, results: &mut Queue<String>
src/strings/tries.rs:226
↓ 1 callersFunctioncollect_prefix
( x: Option<NonNull<Node<T>>>, prefix: &mut String, results: &mut Queue<String>, )
src/strings/tries.rs:209
↓ 1 callersFunctioncounter
(h: Option<NonNull<Node<K, V>>>, mut black: usize)
src/tree/binary/rb2.rs:359
↓ 1 callersMethoddegree
compute the degree of v
src/graph/undirected/graph.rs:74
↓ 1 callersFunctiondel_max
delete the max element rooted at h
src/tree/binary/rb2.rs:239
↓ 1 callersFunctiondelete
# Safety This is highly unsafe, due to pointer 从二叉搜索树中删除节点 x 的方法如下: 如果 x 没有子节点,或者只有一个孩子,直接将 x“切下”; 否则,x 有两个孩子,我们用其右子树中的最小值替换掉 x,然后将右子树中的这一最小值“切掉”。
src/tree/binary/bst.rs:207
↓ 1 callersFunctiondelete
(h: Option<NonNull<Node<K, V>>>, key: &K)
src/tree/binary/rb2.rs:261
← previousnext →101–200 of 655, ranked by callers