MCPcopy Create free account

hub / github.com/alexfertel/rust-algorithms / functions

Functions990 in github.com/alexfertel/rust-algorithms

↓ 199 callersMethodlen
returns the number of elements in the stack
src/data_structures/stack.rs:19
↓ 186 callersMethodpush
mutates the stack by adding an item of type T and returns true
src/data_structures/stack.rs:13
↓ 116 callersMethodinsert
(self: Box<Rope>, value: &str, index: usize)
src/data_structures/rope.rs:166
↓ 91 callersMethoditer
(&self)
src/data_structures/rb_tree.rs:225
↓ 62 callersFunctionadd_edge
(graph: &mut Graph<V, E>, v1: V, v2: V, c: E)
src/graphs/prim.rs:7
↓ 29 callersFunctionadd_edge
(graph: &mut Graph<V, E>, v1: V, v2: V, c: E)
src/graphs/bellman_ford.rs:92
↓ 27 callersMethodcmp
(&self, other: &Self)
src/general/huffman_encoding.rs:38
↓ 24 callersMethodadd_edge
(&mut self, source: usize, sink: usize, capacity: T)
src/graphs/dinic_maxflow.rs:74
↓ 23 callersMethodadd_node
(&mut self, node: &'a T)
src/data_structures/graph.rs:75
↓ 22 callersMethodis_empty
returns true if stack is empty else false
src/data_structures/stack.rs:24
↓ 22 callersMethodpop
mutates the stack by removing and returning a Some<T> if stack is non-empty else None
src/data_structures/stack.rs:36
↓ 20 callersMethodget
(&self, key: impl IntoIterator<Item = Key>)
src/data_structures/trie.rs:41
↓ 20 callersMethodpush_back
(&mut self, val: T)
src/data_structures/linked_list.rs:64
↓ 17 callersFunctionbinary_search
(item: &T, arr: &[T])
src/searching/binary_search.rs:3
↓ 17 callersMethodpush
As we know the primary forms that self can take: self, &mut self and &self, push will change the linked list so we need &mut The push method which the
src/data_structures/stack_using_singly_linked_list.rs:27
↓ 15 callersFunctionhash
hash(s) is defined as BASE^(n-1) * s_0 + BASE^(n-2) * s_1 + ... + BASE^0 * s_(n-1)
src/string/rabin_karp.rs:41
↓ 12 callersMethodadd_edge
(&mut self, edge: (&'a T, &'a T, i32))
src/data_structures/graph.rs:54
↓ 12 callersFunctionderivative_method
(x: f64, y: f64, f: F)
src/math/derivative_method.rs:3
↓ 12 callersMethodinsert
Insert a key into the BTree. # Examples ```rust use rust_algorithms::data_structures::BTree; let mut tree = BTree::new(2); tree.insert(1); tree.ins
src/data_structures/b_tree.rs:192
↓ 12 callersMethodinsert
(&mut self, key: impl IntoIterator<Item = Key>, value: Type)
src/data_structures/trie.rs:30
↓ 12 callersMethodpop_front
(&mut self)
src/data_structures/linked_list.rs:102
↓ 10 callersMethodinsert
Inserts a value into the appropriate location in this tree. # Arguments `value` - The value to insert into this tree. # Examples ```rust use rust_
src/data_structures/binary_search_tree.rs:208
↓ 10 callersMethodinsert
Inserts an element into the Bloom Filter Hashes the element using each hash function and sets the corresponding bit to true Time Complexity: O(k) whe
src/data_structures/bloom_filter.rs:73
↓ 10 callersMethoditer_mut
(&mut self)
src/math/random.rs:105
↓ 9 callersFunctionadd_edge
(graph: &mut Graph<V, E>, v1: V, v2: V, c: E)
src/graphs/dijkstra.rs:58
↓ 9 callersFunctionbingo_sort
(vec: &mut Vec<i32>)
src/sorting/bingo_sort.rs:11
↓ 9 callersFunctioncreate_list
(arr: &[T])
src/data_structures/linked_list.rs:196
↓ 9 callersFunctionknuth_morris_pratt
(text: &str, pattern: &str)
src/string/knuth_morris_pratt.rs:22
↓ 9 callersFunctionrabin_karp
(target: String, pattern: String)
src/string/rabin_karp.rs:4
↓ 9 callersFunctionternary_search
( target: &T, list: &[T], mut start: usize, mut end: usize, )
src/searching/ternary_search.rs:3
↓ 9 callersFunctionternary_search_rec
( target: &T, list: &[T], start: usize, end: usize, )
src/searching/ternary_search_recursive.rs:3
↓ 8 callersFunctionadd_edge
(graph: &mut Graph<V>, a: V, b: V)
src/graphs/graph_enumeration.rs:29
↓ 8 callersFunctionexponential_search
(item: &T, arr: &[T])
src/searching/exponential_search.rs:3
↓ 8 callersFunctionfibonacci_search
(item: &T, arr: &[T])
src/searching/fibonacci_search.rs:4
↓ 8 callersFunctionjump_search
(item: &T, arr: &[T])
src/searching/jump_search.rs:3
↓ 8 callersFunctionpigeonhole_sort
(arr: &mut [i32])
src/sorting/pigeonhole_sort.rs:3
↓ 8 callersFunctionsleep_sort
(vec: &[usize])
src/sorting/sleep_sort.rs:5
↓ 8 callersFunctionstrand_sort
(ip: &mut LinkedList<i32>, op: &mut LinkedList<i32>)
src/sorting/strand_sort.rs:3
↓ 8 callersFunctionwin_check
(player: Players, board: &[Vec<Players>])
src/graphs/depth_first_search_tic_tac_toe.rs:168
↓ 7 callersFunctionadd_edge
(graph: &mut Graph<V, E>, from: V, to: V, weight: E)
src/graphs/topological_sort.rs:44
↓ 7 callersFunctiondist
((x1, y1): &Point, (x2, y2): &Point)
src/geometry/closest_points.rs:25
↓ 7 callersMethodenqueue
(&mut self, item: T)
src/data_structures/queue.rs:14
↓ 7 callersMethodget_u32
(&mut self)
src/math/random.rs:73
↓ 7 callersFunctionlinear_search
(item: &T, arr: &[T])
src/searching/linear_search.rs:3
↓ 7 callersMethodremove
Removes a value from the tree. # Returns `true` if the tree contained the value, `false` otherwise. # Examples ```rust use rust_algorithms::data_s
src/data_structures/avl_tree.rs:146
↓ 7 callersMethodsplit_at
(self: Box<Rope>, index: usize)
src/data_structures/rope.rs:81
↓ 7 callersFunctiontree_sort
Function to sort an array using Tree Sort
src/sorting/tree_sort.rs:54
↓ 6 callersFunctionadd_round_key
add_round_key adds the given round key to the given data. The data is modified in place. The round key must be the same size as the data. # Arguments
src/ciphers/aes.rs:505
↓ 6 callersMethodconcat
(self: Box<Rope>, target: Box<Rope>)
src/data_structures/rope.rs:158
↓ 6 callersFunctioncreate_link
(val: T)
src/data_structures/linked_list.rs:5
↓ 6 callersMethoddequeue
(&mut self)
src/data_structures/queue.rs:30
↓ 6 callersFunctiondivide_u64
(n: u64)
src/ciphers/tea.rs:70
↓ 6 callersFunctionkth_smallest
Returns k-th smallest element of an array, i.e. its order statistics. Time complexity is O(n^2) in the worst case, but only O(n) on average. It mutate
src/searching/kth_smallest.rs:30
↓ 6 callersFunctionkth_smallest_heap
Returns k-th smallest element of an array. Time complexity is stably O(nlog(k)) in all cases Extra space is required to maintain the heap, and it does
src/searching/kth_smallest_heap.rs:13
↓ 6 callersFunctionleft_rotate
(tree: &mut RBTree<K, V>, x: *mut RBNode<K, V>)
src/data_structures/rb_tree.rs:504
↓ 6 callersFunctionminimax
Minimize the actions of the opponent while maximizing the game state of the current player.
src/graphs/depth_first_search_tic_tac_toe.rs:196
↓ 6 callersFunctionright_rotate
(tree: &mut RBTree<K, V>, x: *mut RBNode<K, V>)
src/data_structures/rb_tree.rs:539
↓ 6 callersFunctionto_block
(data: &[u8])
src/ciphers/tea.rs:144
↓ 5 callersFunctionbitonic_sort
(up: bool, x: &mut [i32])
src/sorting/bitonic_sort.rs:1
↓ 5 callersMethodchild_mut
Returns a mutable reference to the left or right child.
src/data_structures/avl_tree.rs:316
↓ 5 callersMethoddelete
(&mut self, key: &K)
src/data_structures/rb_tree.rs:93
↓ 5 callersMethodfind
(&self, key: &K)
src/data_structures/rb_tree.rs:49
↓ 5 callersMethodfind_set
(&mut self, v: usize)
src/graphs/disjoint_set_union.rs:21
↓ 5 callersMethodget_parent
(&self, v: usize, i: usize)
src/graphs/lowest_common_ancestor.rs:29
↓ 5 callersFunctionhamming_distance
(string1: &str, string2: &str)
src/string/hamming_distance.rs:1
↓ 5 callersMethodinsert
Insert a key-value pair into the hash table. # Arguments: `key` - The key to insert. `value` - The value to insert. # Notes: If the key already ex
src/data_structures/hashtable.rs:137
↓ 5 callersMethoditer_mut
'_ is the "explicitly elided lifetime" syntax of Rust
src/data_structures/stack_using_singly_linked_list.rs:85
↓ 5 callersMethodnext
(&mut self)
src/math/random.rs:47
↓ 5 callersMethodprepare
(&mut self, max_number: usize)
src/math/linear_sieve.rs:26
↓ 5 callersFunctiontrapezoidal_integral
(a: f64, b: f64, f: F, precision: u32)
src/math/trapezoidal_integration.rs:1
↓ 4 callersFunctionadd_edge
(tree: &mut Graph<V>, a: V, b: V)
src/graphs/prufer_code.rs:39
↓ 4 callersMethodadjacency_table
(&self)
src/data_structures/graph.rs:30
↓ 4 callersFunctionaes_decrypt
aes_decrypt decrypts the given cipher text using the given AES key. The key must be 128, 192, or 256 bits. # Arguments `cipher_text` - The cipher te
src/ciphers/aes.rs:427
↓ 4 callersFunctionaes_encrypt
aes_encrypt encrypts the given plaintext using the given AES key. The plaintext is padded to the AES block size using PKCS7 padding. The key must be 1
src/ciphers/aes.rs:363
↓ 4 callersMethodcontains
Checks if the tree contains a value. # Arguments `value`: A reference to the value to check for. # Returns `true` if the tree contains the value,
src/data_structures/avl_tree.rs:89
↓ 4 callersFunctiondisplay_board
(board: &[Vec<Players>])
src/graphs/depth_first_search_tic_tac_toe.rs:137
↓ 4 callersFunctionencode
Encode a message into morse code. Given a message, this function encodes it into morse code. It uses a dictionary to map each character to its corres
src/ciphers/morse_code.rs:33
↓ 4 callersMethodfind
Returns the parent of the element
src/data_structures/union_find.rs:21
↓ 4 callersMethodfind_components
(&mut self, adj: &[Vec<usize>])
src/graphs/strongly_connected_components.rs:95
↓ 4 callersMethodget_weight
(&self)
src/data_structures/rope.rs:74
↓ 4 callersMethodheight
Returns the height of the left or right subtree.
src/data_structures/avl_tree.rs:324
↓ 4 callersMethodis_leaf
(&self)
src/data_structures/b_tree.rs:70
↓ 4 callersMethodlen
(&self)
src/data_structures/linked_list.rs:45
↓ 4 callersMethodpartial_cmp
(&self, other: &Self)
src/general/huffman_encoding.rs:30
↓ 4 callersMethodpeek_nth
(&mut self, index: usize)
src/data_structures/linked_list.rs:173
↓ 4 callersFunctionprequel_memes_tree
()
src/data_structures/binary_search_tree.rs:490
↓ 4 callersFunctionprufer_decode
(code: &[V], vertex_list: &[V])
src/graphs/prufer_code.rs:44
↓ 4 callersMethodrebalance
Performs left or right tree rotations to balance this node.
src/data_structures/avl_tree.rs:356
↓ 4 callersFunctionreplace_node
( tree: &mut RBTree<K, V>, parent: *mut RBNode<K, V>, node: *mut RBNode<K, V>, new: *mut RBNod
src/data_structures/rb_tree.rs:574
↓ 4 callersMethodsearch
Search for a key in the hash table. # Arguments: `key` - The key to search for. # Returns: An Option containing a reference to the value if the ke
src/data_structures/hashtable.rs:185
↓ 4 callersFunctionshift_rows_blocks
shift_rows_blocks applies the AES ShiftRows operation to each block in the given data. The data is modified in place. # Arguments `data` - The data
src/ciphers/aes.rs:535
↓ 4 callersFunctionsub_bytes_blocks
sub_bytes_blocks applies the AES S-Box to each block in the given data. The data is modified in place. # Arguments `data` - The data to apply the S-
src/ciphers/aes.rs:521
↓ 4 callersFunctiontranspose_block
transpose_block transposes the given block in place. # Arguments `block` - The block to transpose # Panics This function will panic if the block i
src/ciphers/aes.rs:691
↓ 3 callersFunctionadvance
(x: u128, c: u64, number: u64)
src/math/pollard_rho.rs:37
↓ 3 callersFunctionappend_playaction
Promote only better or collate equally scored game plays
src/graphs/depth_first_search_tic_tac_toe.rs:264
↓ 3 callersFunctionavailable_positions
(board: &[Vec<Players>])
src/graphs/depth_first_search_tic_tac_toe.rs:153
↓ 3 callersMethodbalance_factor
Returns the height difference between the left and right subtrees.
src/data_structures/avl_tree.rs:329
↓ 3 callersFunctionbitonic_merge
(up: bool, x: &mut [i32])
src/sorting/bitonic_sort.rs:16
↓ 3 callersFunctiondecode
Decode a morse code into an alphanumeric message. Given a morse code, this function decodes it into an alphanumeric message. It uses a dictionary to
src/ciphers/morse_code.rs:178
↓ 3 callersMethoddecode
In case the encoding is invalid, `None` is returned
src/general/huffman_encoding.rs:151
next →1–100 of 990, ranked by callers