Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alexfertel/rust-algorithms
/ functions
Functions
990 in github.com/alexfertel/rust-algorithms
⨍
Functions
990
◇
Types & classes
106
↓ 199 callers
Method
len
returns the number of elements in the stack
src/data_structures/stack.rs:19
↓ 186 callers
Method
push
mutates the stack by adding an item of type T and returns true
src/data_structures/stack.rs:13
↓ 116 callers
Method
insert
(self: Box<Rope>, value: &str, index: usize)
src/data_structures/rope.rs:166
↓ 91 callers
Method
iter
(&self)
src/data_structures/rb_tree.rs:225
↓ 62 callers
Function
add_edge
(graph: &mut Graph<V, E>, v1: V, v2: V, c: E)
src/graphs/prim.rs:7
↓ 29 callers
Function
add_edge
(graph: &mut Graph<V, E>, v1: V, v2: V, c: E)
src/graphs/bellman_ford.rs:92
↓ 27 callers
Method
cmp
(&self, other: &Self)
src/general/huffman_encoding.rs:38
↓ 24 callers
Method
add_edge
(&mut self, source: usize, sink: usize, capacity: T)
src/graphs/dinic_maxflow.rs:74
↓ 23 callers
Method
add_node
(&mut self, node: &'a T)
src/data_structures/graph.rs:75
↓ 22 callers
Method
is_empty
returns true if stack is empty else false
src/data_structures/stack.rs:24
↓ 22 callers
Method
pop
mutates the stack by removing and returning a Some<T> if stack is non-empty else None
src/data_structures/stack.rs:36
↓ 20 callers
Method
get
(&self, key: impl IntoIterator<Item = Key>)
src/data_structures/trie.rs:41
↓ 20 callers
Method
push_back
(&mut self, val: T)
src/data_structures/linked_list.rs:64
↓ 17 callers
Function
binary_search
(item: &T, arr: &[T])
src/searching/binary_search.rs:3
↓ 17 callers
Method
push
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 callers
Function
hash
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 callers
Method
add_edge
(&mut self, edge: (&'a T, &'a T, i32))
src/data_structures/graph.rs:54
↓ 12 callers
Function
derivative_method
(x: f64, y: f64, f: F)
src/math/derivative_method.rs:3
↓ 12 callers
Method
insert
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 callers
Method
insert
(&mut self, key: impl IntoIterator<Item = Key>, value: Type)
src/data_structures/trie.rs:30
↓ 12 callers
Method
pop_front
(&mut self)
src/data_structures/linked_list.rs:102
↓ 10 callers
Method
insert
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 callers
Method
insert
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 callers
Method
iter_mut
(&mut self)
src/math/random.rs:105
↓ 9 callers
Function
add_edge
(graph: &mut Graph<V, E>, v1: V, v2: V, c: E)
src/graphs/dijkstra.rs:58
↓ 9 callers
Function
bingo_sort
(vec: &mut Vec<i32>)
src/sorting/bingo_sort.rs:11
↓ 9 callers
Function
create_list
(arr: &[T])
src/data_structures/linked_list.rs:196
↓ 9 callers
Function
knuth_morris_pratt
(text: &str, pattern: &str)
src/string/knuth_morris_pratt.rs:22
↓ 9 callers
Function
rabin_karp
(target: String, pattern: String)
src/string/rabin_karp.rs:4
↓ 9 callers
Function
ternary_search
( target: &T, list: &[T], mut start: usize, mut end: usize, )
src/searching/ternary_search.rs:3
↓ 9 callers
Function
ternary_search_rec
( target: &T, list: &[T], start: usize, end: usize, )
src/searching/ternary_search_recursive.rs:3
↓ 8 callers
Function
add_edge
(graph: &mut Graph<V>, a: V, b: V)
src/graphs/graph_enumeration.rs:29
↓ 8 callers
Function
exponential_search
(item: &T, arr: &[T])
src/searching/exponential_search.rs:3
↓ 8 callers
Function
fibonacci_search
(item: &T, arr: &[T])
src/searching/fibonacci_search.rs:4
↓ 8 callers
Function
jump_search
(item: &T, arr: &[T])
src/searching/jump_search.rs:3
↓ 8 callers
Function
pigeonhole_sort
(arr: &mut [i32])
src/sorting/pigeonhole_sort.rs:3
↓ 8 callers
Function
sleep_sort
(vec: &[usize])
src/sorting/sleep_sort.rs:5
↓ 8 callers
Function
strand_sort
(ip: &mut LinkedList<i32>, op: &mut LinkedList<i32>)
src/sorting/strand_sort.rs:3
↓ 8 callers
Function
win_check
(player: Players, board: &[Vec<Players>])
src/graphs/depth_first_search_tic_tac_toe.rs:168
↓ 7 callers
Function
add_edge
(graph: &mut Graph<V, E>, from: V, to: V, weight: E)
src/graphs/topological_sort.rs:44
↓ 7 callers
Function
dist
((x1, y1): &Point, (x2, y2): &Point)
src/geometry/closest_points.rs:25
↓ 7 callers
Method
enqueue
(&mut self, item: T)
src/data_structures/queue.rs:14
↓ 7 callers
Method
get_u32
(&mut self)
src/math/random.rs:73
↓ 7 callers
Function
linear_search
(item: &T, arr: &[T])
src/searching/linear_search.rs:3
↓ 7 callers
Method
remove
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 callers
Method
split_at
(self: Box<Rope>, index: usize)
src/data_structures/rope.rs:81
↓ 7 callers
Function
tree_sort
Function to sort an array using Tree Sort
src/sorting/tree_sort.rs:54
↓ 6 callers
Function
add_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 callers
Method
concat
(self: Box<Rope>, target: Box<Rope>)
src/data_structures/rope.rs:158
↓ 6 callers
Function
create_link
(val: T)
src/data_structures/linked_list.rs:5
↓ 6 callers
Method
dequeue
(&mut self)
src/data_structures/queue.rs:30
↓ 6 callers
Function
divide_u64
(n: u64)
src/ciphers/tea.rs:70
↓ 6 callers
Function
kth_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 callers
Function
kth_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 callers
Function
left_rotate
(tree: &mut RBTree<K, V>, x: *mut RBNode<K, V>)
src/data_structures/rb_tree.rs:504
↓ 6 callers
Function
minimax
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 callers
Function
right_rotate
(tree: &mut RBTree<K, V>, x: *mut RBNode<K, V>)
src/data_structures/rb_tree.rs:539
↓ 6 callers
Function
to_block
(data: &[u8])
src/ciphers/tea.rs:144
↓ 5 callers
Function
bitonic_sort
(up: bool, x: &mut [i32])
src/sorting/bitonic_sort.rs:1
↓ 5 callers
Method
child_mut
Returns a mutable reference to the left or right child.
src/data_structures/avl_tree.rs:316
↓ 5 callers
Method
delete
(&mut self, key: &K)
src/data_structures/rb_tree.rs:93
↓ 5 callers
Method
find
(&self, key: &K)
src/data_structures/rb_tree.rs:49
↓ 5 callers
Method
find_set
(&mut self, v: usize)
src/graphs/disjoint_set_union.rs:21
↓ 5 callers
Method
get_parent
(&self, v: usize, i: usize)
src/graphs/lowest_common_ancestor.rs:29
↓ 5 callers
Function
hamming_distance
(string1: &str, string2: &str)
src/string/hamming_distance.rs:1
↓ 5 callers
Method
insert
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 callers
Method
iter_mut
'_ is the "explicitly elided lifetime" syntax of Rust
src/data_structures/stack_using_singly_linked_list.rs:85
↓ 5 callers
Method
next
(&mut self)
src/math/random.rs:47
↓ 5 callers
Method
prepare
(&mut self, max_number: usize)
src/math/linear_sieve.rs:26
↓ 5 callers
Function
trapezoidal_integral
(a: f64, b: f64, f: F, precision: u32)
src/math/trapezoidal_integration.rs:1
↓ 4 callers
Function
add_edge
(tree: &mut Graph<V>, a: V, b: V)
src/graphs/prufer_code.rs:39
↓ 4 callers
Method
adjacency_table
(&self)
src/data_structures/graph.rs:30
↓ 4 callers
Function
aes_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 callers
Function
aes_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 callers
Method
contains
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 callers
Function
display_board
(board: &[Vec<Players>])
src/graphs/depth_first_search_tic_tac_toe.rs:137
↓ 4 callers
Function
encode
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 callers
Method
find
Returns the parent of the element
src/data_structures/union_find.rs:21
↓ 4 callers
Method
find_components
(&mut self, adj: &[Vec<usize>])
src/graphs/strongly_connected_components.rs:95
↓ 4 callers
Method
get_weight
(&self)
src/data_structures/rope.rs:74
↓ 4 callers
Method
height
Returns the height of the left or right subtree.
src/data_structures/avl_tree.rs:324
↓ 4 callers
Method
is_leaf
(&self)
src/data_structures/b_tree.rs:70
↓ 4 callers
Method
len
(&self)
src/data_structures/linked_list.rs:45
↓ 4 callers
Method
partial_cmp
(&self, other: &Self)
src/general/huffman_encoding.rs:30
↓ 4 callers
Method
peek_nth
(&mut self, index: usize)
src/data_structures/linked_list.rs:173
↓ 4 callers
Function
prequel_memes_tree
()
src/data_structures/binary_search_tree.rs:490
↓ 4 callers
Function
prufer_decode
(code: &[V], vertex_list: &[V])
src/graphs/prufer_code.rs:44
↓ 4 callers
Method
rebalance
Performs left or right tree rotations to balance this node.
src/data_structures/avl_tree.rs:356
↓ 4 callers
Function
replace_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 callers
Method
search
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 callers
Function
shift_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 callers
Function
sub_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 callers
Function
transpose_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 callers
Function
advance
(x: u128, c: u64, number: u64)
src/math/pollard_rho.rs:37
↓ 3 callers
Function
append_playaction
Promote only better or collate equally scored game plays
src/graphs/depth_first_search_tic_tac_toe.rs:264
↓ 3 callers
Function
available_positions
(board: &[Vec<Players>])
src/graphs/depth_first_search_tic_tac_toe.rs:153
↓ 3 callers
Method
balance_factor
Returns the height difference between the left and right subtrees.
src/data_structures/avl_tree.rs:329
↓ 3 callers
Function
bitonic_merge
(up: bool, x: &mut [i32])
src/sorting/bitonic_sort.rs:16
↓ 3 callers
Function
decode
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 callers
Method
decode
In case the encoding is invalid, `None` is returned
src/general/huffman_encoding.rs:151
next →
1–100 of 990, ranked by callers