Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aladdinpersson/Algorithms-Collection-Python
/ functions
Functions
222 in github.com/aladdinpersson/Algorithms-Collection-Python
⨍
Functions
222
◇
Types & classes
23
↓ 25 callers
Method
main
(self, data)
Algorithms/other/median_maintenance.py:49
↓ 11 callers
Method
alignment
(self)
Algorithms/dynamic_programming/sequence_alignment.py:57
↓ 9 callers
Function
bubblesort
(L)
Algorithms/sorting/bubblesort.py:11
↓ 9 callers
Method
weighted_interval
(self)
Algorithms/dynamic_programming/weighted_interval_scheduling.py:58
↓ 8 callers
Function
binarysearch_iterative
(L, target)
Algorithms/other/binarysearch.py:11
↓ 8 callers
Function
binarysearch_recursive
(L, target, low, high)
Algorithms/other/binarysearch.py:30
↓ 8 callers
Function
insertionsort
(L)
Algorithms/sorting/insertionsort.py:10
↓ 8 callers
Function
quicksort_randomized
(L)
Algorithms/sorting/randomized_quicksort.py:14
↓ 7 callers
Function
merge_sort
(array)
Algorithms/sorting/mergesort.py:1
↓ 7 callers
Function
quicksort_firstpivot
(L)
Algorithms/sorting/quicksort.py:4
↓ 7 callers
Function
quicksort_lastpivot
(x)
Algorithms/sorting/quicksort.py:27
↓ 7 callers
Function
selectionsort
(L)
Algorithms/sorting/selectionsort.py:25
↓ 6 callers
Function
intersection
(A, B)
Algorithms/math/intersection_of_two_sets/intersection_of_two_sets.py:13
↓ 6 callers
Function
interval_scheduling
(R, O)
Algorithms/other/interval_scheduling.py:11
↓ 6 callers
Function
kruskal
(G, num_nodes)
Algorithms/graphtheory/kruskal/kruskal_unionfind.py:27
↓ 6 callers
Function
prims_algo
(G, start=1)
Algorithms/graphtheory/prims/prim_heap.py:41
↓ 6 callers
Function
union
(A, B)
Algorithms/math/union_of_two_sets/union_of_two_sets.py:13
↓ 5 callers
Function
BFS
:param G: Graph with G = {from_node1:[to_node1, to_node2], from_node2: [to_node,] etc} :param start_node: starting node to run BFS from :
Algorithms/graphtheory/breadth-first-search/BFS_queue_iterative.py:11
↓ 5 callers
Function
dijkstra
:param G: {from_node1: {to_node1:cost1, to_node2:cost2}, from_node2 : {.., etc.}, ...} :param start: starting node :param end: ending nod
Algorithms/graphtheory/dijkstra/dijkstra.py:11
↓ 5 callers
Function
dijkstra
(G, start, end=None)
Algorithms/graphtheory/dijkstra/heapdijkstra.py:36
↓ 5 callers
Function
function
(x)
Algorithms/numerical_methods/bisection.py:10
↓ 5 callers
Function
knapsack
(n, C, weights, values)
Algorithms/dynamic_programming/knapsack/knapsack_bottomup.py:27
↓ 5 callers
Function
topological_ordering
(graph, degree_incoming)
Algorithms/graphtheory/kahns-toposort/kahn_topological_ordering.py:17
↓ 3 callers
Function
bellman_ford
:param G: {from_node1: {to_node1, cost1, to_node2, cost2}, from_node2: {etc}} :param start: node to start from
Algorithms/graphtheory/bellman-ford/bellman_ford.py:13
↓ 3 callers
Method
compute_opt
(self, j)
Algorithms/dynamic_programming/weighted_interval_scheduling.py:46
↓ 2 callers
Function
decrypt
(cipher, shift=3)
Algorithms/cryptology/ceasar_shifting_cipher/ceasar_shift_cipher.py:36
↓ 2 callers
Function
decrypt
(encrypted, n, d)
Algorithms/cryptology/RSA_algorithm/RSA.py:86
↓ 2 callers
Function
encrypt
(message, shift=3)
Algorithms/cryptology/ceasar_shifting_cipher/ceasar_shift_cipher.py:25
↓ 2 callers
Function
encrypt
(message, n, e)
Algorithms/cryptology/RSA_algorithm/RSA.py:70
↓ 2 callers
Function
extended_euclidean
(a, b)
Algorithms/cryptology/RSA_algorithm/euclid_gcd.py:11
↓ 2 callers
Function
function
(x)
Algorithms/numerical_methods/fixpoint.py:10
↓ 2 callers
Function
xor
(s1, s2)
Algorithms/cryptology/one_time_pad/one_time_pad.py:12
↓ 1 callers
Function
DFS
:param G: Graph with G = {from_node1:[to_node1, to_node2], from_node2: [to_node,] etc} :param start_node: starting node to run BFS from :
Algorithms/graphtheory/depth-first-search/DFS_stack_iterative.py:11
↓ 1 callers
Function
bisection
(a0, b0, eps, delta, maxit)
Algorithms/numerical_methods/bisection.py:15
↓ 1 callers
Function
build_tree
(heap)
Algorithms/other/Huffman/Huffman.py:41
↓ 1 callers
Function
construct_path_to_take
(next, start, end)
Algorithms/graphtheory/floyd-warshall/floyd-warshall.py:71
↓ 1 callers
Function
create_mapping
(root, map={}, binarytext="")
Algorithms/other/Huffman/Huffman.py:54
↓ 1 callers
Function
decrypt
(cipher_text, key)
Algorithms/cryptology/one_time_pad/one_time_pad.py:37
↓ 1 callers
Function
decrypt
(cipher, Kinv)
Algorithms/cryptology/hill_cipher/hill_cipher.py:70
↓ 1 callers
Function
decrypt
(cipher, key)
Algorithms/cryptology/vigenere_cipher/vigenere.py:37
↓ 1 callers
Function
encrypt
(message, key)
Algorithms/cryptology/one_time_pad/one_time_pad.py:21
↓ 1 callers
Function
encrypt
(message, K)
Algorithms/cryptology/hill_cipher/hill_cipher.py:41
↓ 1 callers
Function
encrypt
(message, key)
Algorithms/cryptology/vigenere_cipher/vigenere.py:21
↓ 1 callers
Function
eratosthenes
(n)
Algorithms/math/sieve_of_eratosthenes/sieve_eratosthenes.py:7
↓ 1 callers
Function
extended_euclidean
(a, b)
Algorithms/math/extended_euclidean_algorithm/euclid_gcd.py:11
↓ 1 callers
Function
find_opt
(i, c, M, values, items, weights)
Algorithms/dynamic_programming/knapsack/knapsack_bottomup.py:13
↓ 1 callers
Method
find_solution
(self, OPT, m, n)
Algorithms/dynamic_programming/sequence_alignment.py:30
↓ 1 callers
Method
find_solution
(self, j)
Algorithms/dynamic_programming/weighted_interval_scheduling.py:34
↓ 1 callers
Function
fixpoint
(x0, tol)
Algorithms/numerical_methods/fixpoint.py:14
↓ 1 callers
Function
floyd_warshall
(adj_matrix, next)
Algorithms/graphtheory/floyd-warshall/floyd-warshall.py:52
↓ 1 callers
Function
gcd_iterative
(a, b)
Algorithms/math/euclid_gcd/euclid_gcd.py:17
↓ 1 callers
Function
generate_all_values
()
Algorithms/cryptology/RSA_algorithm/RSA.py:57
↓ 1 callers
Function
generate_d
(e, totient)
Algorithms/cryptology/RSA_algorithm/RSA.py:50
↓ 1 callers
Function
generate_e
(totient)
Algorithms/cryptology/RSA_algorithm/RSA.py:37
↓ 1 callers
Function
generate_pq
(bits)
Algorithms/cryptology/RSA_algorithm/RSA.py:15
↓ 1 callers
Function
get_random_edge
(G)
Algorithms/graphtheory/kargers/kargermincut.py:28
↓ 1 callers
Function
hopesort
(L)
Algorithms/sorting/hopesort.py:11
↓ 1 callers
Function
kadane_algorithm
(array)
Algorithms/other/Kadanes_algorithm.py:12
↓ 1 callers
Function
karatsuba
(x, y)
Algorithms/math/karatsuba/karatsuba.py:9
↓ 1 callers
Function
karger_contraction
(G)
Algorithms/graphtheory/kargers/kargermincut.py:34
↓ 1 callers
Function
knapsack
(n, C, W, v, items, arr)
Algorithms/dynamic_programming/knapsack/knapsack_memoization_recursive_topdown.py:12
↓ 1 callers
Function
knapsack
(n, C, W, v, items)
Algorithms/dynamic_programming/knapsack/knapsack_naive_recursive.py:12
↓ 1 callers
Function
kruskal
(G, num_nodes)
Algorithms/graphtheory/kruskal/kruskal.py:33
↓ 1 callers
Function
load_graph
()
Algorithms/graphtheory/kargers/kargermincut.py:17
↓ 1 callers
Function
load_graph
(file_name)
Algorithms/graphtheory/floyd-warshall/floyd-warshall.py:11
↓ 1 callers
Function
load_graph
(path="edges.txt")
Algorithms/graphtheory/prims/prim_naive.py:11
↓ 1 callers
Function
load_graph
(file="edges.txt")
Algorithms/graphtheory/prims/prim_heap.py:15
↓ 1 callers
Function
load_graph
(file="edges.txt")
Algorithms/graphtheory/kruskal/kruskal_unionfind.py:9
↓ 1 callers
Function
load_graph
(file="edges.txt")
Algorithms/graphtheory/kruskal/kruskal.py:15
↓ 1 callers
Function
longest_increasing_subsequence
(nums)
Algorithms/dynamic_programming/longest_increasing_subsequence.py:8
↓ 1 callers
Function
main
()
Algorithms/cryptology/one_time_pad/one_time_pad.py:53
↓ 1 callers
Function
main
()
Algorithms/cryptology/hill_cipher/hill_cipher.py:94
↓ 1 callers
Function
main
()
Algorithms/cryptology/RSA_algorithm/RSA.py:114
↓ 1 callers
Function
main
()
Algorithms/cryptology/vigenere_cipher/vigenere.py:53
↓ 1 callers
Function
main
()
Algorithms/other/Huffman/Huffman.py:96
↓ 1 callers
Function
main
()
Algorithms/graphtheory/kargers/kargermincut.py:57
↓ 1 callers
Function
main
()
Algorithms/numerical_methods/bisection.py:57
↓ 1 callers
Function
main
()
Algorithms/numerical_methods/fixpoint.py:25
↓ 1 callers
Function
make_frequency_dict
(file="huffman.txt")
Algorithms/other/Huffman/Huffman.py:16
↓ 1 callers
Function
make_heap
(freq)
Algorithms/other/Huffman/Huffman.py:32
↓ 1 callers
Function
matrix_mod_inv
We find the matrix modulus inverse by Step 1) Find determinant Step 2) Find determinant value in a specific modulus (usually length of alphabe
Algorithms/cryptology/hill_cipher/hill_cipher.py:25
↓ 1 callers
Method
medmain_insert
(self, x)
Algorithms/other/median_maintenance.py:23
↓ 1 callers
Function
merge
(left, right)
Algorithms/sorting/mergesort.py:13
↓ 1 callers
Function
merge_and_count
(left, right)
Algorithms/other/counting_inversions.py:15
↓ 1 callers
Function
merge_sort
(array)
Algorithms/other/counting_inversions.py:1
↓ 1 callers
Function
nnTSP
(adj)
Algorithms/graphtheory/nearest-neighbor-tsp/NearestNeighborTSP.py:63
↓ 1 callers
Function
parseGraph
(path)
Algorithms/graphtheory/nearest-neighbor-tsp/NearestNeighborTSP.py:25
↓ 1 callers
Function
pollard_p1
(n)
Algorithms/math/pollard_p1/pollard_p1.py:14
↓ 1 callers
Method
previous_intervals
(self)
Algorithms/dynamic_programming/weighted_interval_scheduling.py:22
↓ 1 callers
Function
primefactorization
(n)
Algorithms/math/prime_factorization/primefactorization.py:14
↓ 1 callers
Function
prims_algo
(edge_list, num_nodes)
Algorithms/graphtheory/prims/prim_naive.py:25
↓ 1 callers
Function
rankNeighbors
(node,adj)
Algorithms/graphtheory/nearest-neighbor-tsp/NearestNeighborTSP.py:45
↓ 1 callers
Function
selectionsort_intuitive
(L)
Algorithms/sorting/selectionsort.py:10
Function
DFS
:param G: G = {from_node1:[to_node1, to_node2], from_node2: [to_node,] etc} :param curr_node: Node currently at, run from beginning this is t
Algorithms/graphtheory/depth-first-search/DFS_recursive.py:8
Method
__init__
(self)
Algorithms/other/median_maintenance.py:19
Method
__init__
(self, ch, freq, left=None, right=None)
Algorithms/other/Huffman/Huffman.py:6
Method
__init__
(self, x, y)
Algorithms/dynamic_programming/sequence_alignment.py:23
Method
__init__
(self, I)
Algorithms/dynamic_programming/weighted_interval_scheduling.py:17
Method
__lt__
(self, other)
Algorithms/other/Huffman/Huffman.py:12
Function
decode
(binarystring, root)
Algorithms/other/Huffman/Huffman.py:70
next →
1–100 of 222, ranked by callers