Python algorithms4
Project description
SEANLAB Algorithms4 Pythonic Data Structures and Algorithms
Minimal and clean example implementations of data structures and algorithms in Python 3.
Contributing
Thanks for your interest in contributing! There are many ways to contribute to this project. Get started here
Tests
Use unittest
For running all tests write down:
$ python3 -m unittest discover tests
For running some specific tests you can do this as following (Ex: sort):
$ python3 -m unittest tests.test_sort
Use pytest
For running all tests write down:
$ python3 -m pytest tests
Install
If you want to use the API algorithms in your code, it is as simple as:
$ pip3 install seanalgorithms4
You can test by creating a python file: (Ex: use merge_sort
in sort
)
from seanalgorithms4.sort import merge_sort
if __name__ == "__main__":
my_list = [1, 8, 3, 5, 6]
my_list = merge_sort(my_list)
print(my_list)
Uninstall
If you want to uninstall seanalgorithms4, it is as simple as:
$ pip3 uninstall -y seanalgorithms4
- algorithms4_practice
- 1.bisection
- 2.intersection
- 3.lu_decomposition
- 4.newton_method
- in_static_equilibrium
- newton_raphson_method
- 1.all_combinations
- 2.all_permutations
- 3.all_subsequences
- 4.minimax
- 5.n_queens
- 6.sudoku
- 7.sum_of_subsets
- quine_mc_cluskey_x
- affine_cipher
- atbash
- base16
- base32
- base64_cipher
- base85
- brute_force_caesar_cipher
- caesar_cipher
- cryptomath_module
- elgamal_key_generator
- hill_cipher
- morse_code_implementation
- onepad_cipher
- playfair_cipher
- rabin_miller
- rot13
- rsa_cipher
- rsa_key_generator
- simple_substitution_cipher
- trafid_cipher
- transposition_cipher
- transposition_cipher_encrypt_decrypt_file
- vigenere_cipher
- xor_cipher
- burrows_wheeler
- huffman
- peak_signal_to_noise_ratio
- 1.decimal_to_binary
- 2.decimal_to_hexadecimal
- 3.decimal_to_octal
- 1.avl_tree
- 2.basic_binary_tree
- 3.binary_search_tree
- 4.fenwick_tree
- 5.lazy_segment_tree
- 6.lca
- 7.red_black_tree
- 8.segment_tree
- treap
- double_hash
- hash_table
- hash_table_with_linked_list
- quadratic_probing
- 1.prime_numbers
- binomial_heap
- heap
- doubly_linked_list
- is_palindrome
- singly_linked_list
- swap_nodes
- 1.double_ended_queue
- queue_on_list
- queue_on_pseudo_stack
- 1.balanced_parentheses
- 1.balanced_parentheses2
- 2.infix_to_postfix_conversion
- 3.infix_to_prefix_conversion
- 4.next_greater_element
- 5.postfix_evaluation
- 6.stock_span_problem
- stack
- trie
- change_contrast
- test_digital_image_processing
- canny
- convolve
- gaussian_filter
- median_filter
- sobel_filter
- 1.closest_pair_of_points
- 2.convex_hull
- 3.inversions
- 4.max_subarray_sum
- 1.abbreviation
- 10.k_means_clustering_tensorflow
- 11.knapsack
- 12.longest_common_subsequence
- 13.longest_increasing_subsequence
- 14.longest_increasing_subsequence_o(nlogn)
- 15.longest_sub_array
- 16.matrix_chain_order
- 17.max_sub_array
- 18.minimum_partition
- 19.rod_cutting
- 2.bitmask
- 20.subset_generation
- 21.sum_of_subset
- 23.fibonacci
- 24.floyd_warshall
- 3.climbing_stairs
- 4.coin_change
- 5.edit_distance
- 6.factorial
- 7.fast_fibonacci
- 8.fractional_knapsack
- 9.integer_partition
- fibonacci
- floyd_warshall
- recieve_file
- send_file
- 1.a_star
- 10.depth_first_search
- 11.dfs
- 12.dijkstra
- 13.dijkstra_2
- 14.dijkstra_algorithm
- 15.edmonds_karp_multiple_source_and_sink
- 16.eulerian_path_and_circuit_for_undirected_graph
- 17.even_tree
- 18.finding_bridges
- 19.graph_list
- 2.articulation_points
- 20.graph_matrix
- 21.graphs_floyd_warshall
- 22.kahns_algorithm_long
- 23.kahns_algorithm_topo
- 24.minimum_spanning_tree_prims
- 25.multi_hueristic_astar
- 3.basic_graphs
- 4.bellman_ford
- 5.bfs
- 6.bfs_shortest_path
- 7.breadth_first_search
- 8.check_bipartite_graph_bfs
- 9.check_bipartite_graph_dfs
- directed_and_undirected_(weighted)_graph_x
- minimum_spanning_tree_kruskal_x
- page_rank_x
- prim_x
- scc_kosaraju_x
- tarjans_scc_x
- chaos_machine
- enigma_machine
- md5
- sha1
- lib
- polynom-for-points
- tests
- decision_tree
- gradient_descent
- knn_sklearn
- k_means_clust
- linear_regression
- logistic_regression
- scoring_functions
- sorted_vector_machines
- random_forest_classification
- random_forest_regression
- 3n+1
- abs
- abs_max
- abs_min
- average_mean
- average_median
- basic_maths
- binary_exponentiation
- collatz_sequence
- extended_euclidean_algorithm
- factorial_python
- factorial_recursive
- fermat_little_theorem
- fibonacci
- fibonacci_sequence_recursion
- find_lcm
- find_max
- find_min
- gaussian
- greater_common_divisor
- is_square_free
- largest_of_very_large_numbers
- lucas_lehmer_primality_test
- lucas_series
- mobius_function
- modular_exponential
- newton_raphson
- prime_check
- prime_factors
- quadratic_equations_complex_numbers
- radix2_fft
- segmented_sieve
- sieve_of_eratosthenes
- simpson_rule
- test
- test_prime_check
- trapezoidal_rule
- volume
- zellers_congruence
- 1.matrix_operation
- 2.nth_fibonacci_using_matrix_exponentiation
- 3.rotate_matrix
- 4.searching_in_sorted_matrix
- 5.spiral_print
- sherman_morrison_x
- test_matrix_operation
- 1.ford_fulkerson
- 2.minimum_cut
- back_propagation_neural_network
- convolution_neural_network
- perceptron
- anagrams
- binary_exponentiation
- binary_exponentiation_2
- detecting_english_programmatically
- euclidean_gcd
- fischer_yates_shuffle
- frequency_finder
- game_of_life
- linear_congruential_generator
- nested_brackets
- palindrome
- password_generator
- primelib
- sierpinski_triangle
- tower_of_hanoi
- two_sum
- word_patterns
- sol1
- sol2
- sol3
- sol4
- sol5
- sol6
- sol1
- sol2
- sol3
- sol4
- sol1
- sol2
- sol1
- sol2
- sol1
- sol2
- sol1
- sol2
- sol3
- sol1
- sol2
- sol3
- sol1
- sol2
- sol1
- sol2
- sol3
- sol1
- sol2
- sol3
- sol1
- sol2
- sol1
- sol2
- sol1
- sol1
- sol2
- sol1
- sol1
- sol2
- sol1
- sol1
- sol1
- sol2
- sol1
- sol1
- sol2
- sol1
- sol1
- sol1
- sol2
- sol1
- solution
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- build_directory_md
- validate_filenames
- 1.binary_search
- 10.jump_search
- 11.linear_search
- 2.interpolation_search
- 3.jump_search
- 4.linear_search
- 5.quick_select
- 6.sentinel_linear_search
- 7.ternary_search
- 8.binary_search
- 9.interpolation_search
- binary_search
- linear_search
- quick_select
- sentinel_linear_search
- tabu_search
- ternary_search
- 1.bitonic_sort
- 10.heap_sort
- 11.insertion_sort
- 12.merge_sort
- 13.merge_sort_fastest
- 14.odd_even_transposition_parallel
- 15.odd_even_transposition_single_threaded
- 16.pancake_sort
- 18.external_sort
- 19.pancake_sort
- 2.bogo_sort
- 20.pigeon_sort
- 21.quick_sort
- 22.quick_sort_3_partition
- 23.radix_sort
- 24.random_pivot_quick_sort
- 25.selection_sort
- 26.shell_sort
- 27.tim_sort
- 28.topological_sort
- 29.tree_sort
- 3.bubble_sort
- 30.wiggle_sort
- 4.bucket_sort
- 5.cocktail_shaker_sort
- 6.comb_sort
- 7.counting_sort
- 8.cycle_sort
- 9.gnome_sort
- bitonic_sort
- bogo_sort
- bubble_sort
- bucket_sort
- cocktail_shaker_sort
- comb_sort
- counting_sort
- cycle_sort
- external_sort
- gnome_sort
- heap_sort
- insertion_sort
- merge_sort
- merge_sort_fastest
- odd_even_transposition_parallel
- odd_even_transposition_single_threaded
- pancake_sort
- quick_sort
- quick_sort_3_partition
- radix_sort
- random_normal_distribution_quicksort_x
- random_pivot_quick_sort
- selection_sort
- shell_sort
- tim_sort
- topological_sort
- tree_sort
- wiggle_sort
- 1.boyer_moore_search
- 2.knuth_morris_pratt
- levenshtein_distance
- manacher
- min_cost_string_conversion
- naive_string_search
- rabin_karp
- binary_tree_traversals
- bisection
- intersection
- in_static_equilibrium
- lu_decomposition
- newton_method
- newton_raphson_method
- all_combinations
- all_permutations
- all_subsequences
- minimax
- n_queens
- sudoku
- sum_of_subsets
- quine_mc_cluskey
- affine_cipher
- atbash
- base16
- base32
- base64_cipher
- base85
- brute_force_caesar_cipher
- caesar_cipher
- cryptomath_module
- elgamal_key_generator
- hill_cipher
- morse_code_implementation
- onepad_cipher
- playfair_cipher
- rabin_miller
- rot13
- rsa_cipher
- rsa_key_generator
- simple_substitution_cipher
- trafid_cipher
- transposition_cipher
- transposition_cipher_encrypt_decrypt_file
- vigenere_cipher
- xor_cipher
- burrows_wheeler
- huffman
- peak_signal_to_noise_ratio
- decimal_to_binary
- decimal_to_hexadecimal
- decimal_to_octal
- avl_tree
- basic_binary_tree
- binary_search_tree
- fenwick_tree
- lazy_segment_tree
- lca
- red_black_tree
- segment_tree
- treap
- double_hash
- hash_table
- hash_table_with_linked_list
- quadratic_probing
- prime_numbers
- binomial_heap
- heap
- doubly_linked_list
- is_palindrome
- singly_linked_list
- swap_nodes
- double_ended_queue
- queue_on_list
- queue_on_pseudo_stack
- balanced_parentheses
- infix_to_postfix_conversion
- infix_to_prefix_conversion
- next_greater_element
- postfix_evaluation
- stack
- stock_span_problem
- trie
- change_contrast
- test_digital_image_processing
- canny
- convolve
- gaussian_filter
- median_filter
- sobel_filter
- closest_pair_of_points
- convex_hull
- inversions
- max_subarray_sum
- abbreviation
- bitmask
- climbing_stairs
- coin_change
- edit_distance
- factorial
- fast_fibonacci
- fibonacci
- floyd_warshall
- fractional_knapsack
- integer_partition
- knapsack
- k_means_clustering_tensorflow
- longest_common_subsequence
- longest_increasing_subsequence
- longest_increasing_subsequence_o(nlogn)
- longest_sub_array
- matrix_chain_order
- max_sub_array
- minimum_partition
- rod_cutting
- subset_generation
- sum_of_subset
- recieve_file
- send_file
- articulation_points
- a_star
- basic_graphs
- bellman_ford
- bfs
- bfs_shortest_path
- breadth_first_search
- check_bipartite_graph_bfs
- check_bipartite_graph_dfs
- depth_first_search
- dfs
- dijkstra
- dijkstra_2
- dijkstra_algorithm
- directed_and_undirected_(weighted)_graph
- edmonds_karp_multiple_source_and_sink
- eulerian_path_and_circuit_for_undirected_graph
- even_tree
- finding_bridges
- graphs_floyd_warshall
- graph_list
- graph_matrix
- kahns_algorithm_long
- kahns_algorithm_topo
- minimum_spanning_tree_kruskal
- minimum_spanning_tree_prims
- multi_hueristic_astar
- page_rank
- prim
- scc_kosaraju
- tarjans_scc
- chaos_machine
- enigma_machine
- md5
- sha1
- lib
- polynom-for-points
- tests
- decision_tree
- gradient_descent
- knn_sklearn
- k_means_clust
- linear_regression
- logistic_regression
- scoring_functions
- sorted_vector_machines
- random_forest_classification
- random_forest_regression
- 3n+1
- abs
- abs_max
- abs_min
- average_mean
- average_median
- basic_maths
- binary_exponentiation
- collatz_sequence
- extended_euclidean_algorithm
- factorial_python
- factorial_recursive
- fermat_little_theorem
- fibonacci
- fibonacci_sequence_recursion
- find_lcm
- find_max
- find_min
- gaussian
- greater_common_divisor
- is_square_free
- largest_of_very_large_numbers
- lucas_lehmer_primality_test
- lucas_series
- mobius_function
- modular_exponential
- newton_raphson
- prime_check
- prime_factors
- quadratic_equations_complex_numbers
- radix2_fft
- segmented_sieve
- sieve_of_eratosthenes
- simpson_rule
- test_prime_check
- trapezoidal_rule
- volume
- zellers_congruence
- matrix_operation
- nth_fibonacci_using_matrix_exponentiation
- rotate_matrix
- searching_in_sorted_matrix
- sherman_morrison
- spiral_print
- test_matrix_operation
- ford_fulkerson
- minimum_cut
- back_propagation_neural_network
- convolution_neural_network
- perceptron
- anagrams
- binary_exponentiation
- binary_exponentiation_2
- detecting_english_programmatically
- euclidean_gcd
- fischer_yates_shuffle
- frequency_finder
- game_of_life
- linear_congruential_generator
- nested_brackets
- palindrome
- password_generator
- primelib
- sierpinski_triangle
- tower_of_hanoi
- two_sum
- word_patterns
- sol1
- sol2
- sol3
- sol4
- sol5
- sol6
- sol1
- sol2
- sol3
- sol4
- sol1
- sol2
- sol1
- sol2
- sol1
- sol2
- sol1
- sol2
- sol3
- sol1
- sol2
- sol3
- sol1
- sol2
- sol1
- sol2
- sol3
- sol1
- sol2
- sol3
- sol1
- sol2
- sol1
- sol2
- sol1
- sol1
- sol2
- sol1
- sol1
- sol2
- sol1
- sol1
- sol1
- sol2
- sol1
- sol1
- sol2
- sol1
- sol1
- sol1
- sol2
- sol1
- solution
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- sol1
- build_directory_md
- validate_filenames
- binary_search
- interpolation_search
- jump_search
- linear_search
- quick_select
- sentinel_linear_search
- tabu_search
- ternary_search
- bitonic_sort
- bogo_sort
- bubble_sort
- bucket_sort
- cocktail_shaker_sort
- comb_sort
- counting_sort
- cycle_sort
- external_sort
- gnome_sort
- heap_sort
- insertion_sort
- merge_sort
- merge_sort_fastest
- odd_even_transposition_parallel
- odd_even_transposition_single_threaded
- pancake_sort
- pigeon_sort
- quick_sort
- quick_sort_3_partition
- radix_sort
- random_normal_distribution_quicksort
- random_pivot_quick_sort
- selection_sort
- shell_sort
- tim_sort
- topological_sort
- tree_sort
- wiggle_sort
- boyer_moore_search
- knuth_morris_pratt
- levenshtein_distance
- manacher
- min_cost_string_conversion
- naive_string_search
- rabin_karp
- binary_tree_traversals
Arithmetic Analysis
Backtracking
Boolean Algebra
Ciphers
- affine cipher
- atbash
- base16
- base32
- base64 cipher
- base85
- brute force caesar cipher
- caesar cipher
- cryptomath module
- elgamal key generator
- hill cipher
- morse code implementation
- onepad cipher
- playfair cipher
- rabin miller
- rot13
- rsa cipher
- rsa key generator
- simple substitution cipher
- trafid cipher
- transposition cipher
- transposition cipher encrypt decrypt file
- vigenere cipher
- xor cipher
Compression
Conversions
Data Structures
- Binary Tree
- Hashing
- Number Theory
- Heap
- Linked List
- Queue
- Stacks
- Trie
Digital Image Processing
* [change contrast](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/change_contrast.py)
- Edge Detection
- Filters
Divide And Conquer
Dynamic Programming
- abbreviation
- bitmask
- climbing stairs
- coin change
- edit distance
- factorial
- fast fibonacci
- fibonacci
- floyd warshall
- fractional knapsack
- integer partition
- k means clustering tensorflow
- knapsack
- longest common subsequence
- longest increasing subsequence
- longest increasing subsequence o(nlogn)
- longest sub array
- matrix chain order
- max sub array
- minimum partition
- rod cutting
- subset generation
- sum of subset
File Transfer
Graphs
- a star
- articulation points
- basic graphs
- bellman ford
- bfs
- bfs shortest path
- breadth first search
- check bipartite graph bfs
- check bipartite graph dfs
- depth first search
- dfs
- dijkstra
- dijkstra 2
- dijkstra algorithm
- directed and undirected (weighted) graph
- edmonds karp multiple source and sink
- eulerian path and circuit for undirected graph
- even tree
- finding bridges
- graph list
- graph matrix
- graphs floyd warshall
- kahns algorithm long
- kahns algorithm topo
- minimum spanning tree kruskal
- minimum spanning tree prims
- multi hueristic astar
- page rank
- prim
- scc kosaraju
- tarjans scc
Hashes
Linear Algebra
Machine Learning
- decision tree
- gradient descent
- k means clust
- knn sklearn
- linear regression
- logistic regression
- naive bayes
- Random Forest Classification
- Random Forest Regression
- reuters one vs rest classifier
- scoring functions
- sorted vector machines
Maths
- 3n+1
- abs
- abs max
- abs min
- average mean
- average median
- basic maths
- binary exponentiation
- collatz sequence
- extended euclidean algorithm
- factorial python
- factorial recursive
- fermat little theorem
- fibonacci
- fibonacci sequence recursion
- find lcm
- find max
- find min
- gaussian
- greater common divisor
- is square free
- largest of very large numbers
- lucas lehmer primality test
- lucas series
- mobius function
- modular exponential
- newton raphson
- prime check
- prime factors
- quadratic equations complex numbers
- segmented sieve
- sieve of eratosthenes
- simpson rule
- test prime check
- trapezoidal rule
- volume
- zellers congruence
Matrix
- matrix operation
- nth fibonacci using matrix exponentiation
- rotate matrix
- searching in sorted matrix
- spiral print
- Tests
Networking Flow
Neural Network
- back propagation neural network
- convolution neural network
- fully connected neural network
- perceptron
Other
- anagrams
- binary exponentiation
- binary exponentiation 2
- detecting english programmatically
- euclidean gcd
- fischer yates shuffle
- food wastage analysis from 1961-2013 fao
- frequency finder
- game of life
- linear congruential generator
- nested brackets
- palindrome
- password generator
- primelib
- sierpinski triangle
- tower of hanoi
- two sum
- word patterns
Project Euler
- Problem 01
- Problem 02
- Problem 03
- Problem 04
- Problem 05
- Problem 06
- Problem 07
- Problem 08
- Problem 09
- Problem 10
- Problem 11
- Problem 12
- Problem 13
- Problem 14
- Problem 15
- Problem 16
- Problem 17
- Problem 18
- Problem 19
- Problem 20
- Problem 21
- Problem 22
- Problem 234
- Problem 24
- Problem 25
- Problem 28
- Problem 29
- Problem 31
- Problem 36
- Problem 40
- Problem 48
- Problem 52
- Problem 53
- Problem 56
- Problem 76
Searches
- binary search
- interpolation search
- jump search
- linear search
- quick select
- sentinel linear search
- tabu search
- ternary search
Sorts
- bitonic sort
- bogo sort
- bubble sort
- bucket sort
- cocktail shaker sort
- comb sort
- counting sort
- cycle sort
- external sort
- gnome sort
- heap sort
- insertion sort
- merge sort
- merge sort fastest
- odd even transposition parallel
- odd even transposition single threaded
- pancake sort
- pigeon sort
- quick sort
- quick sort 3 partition
- radix sort
- random normal distribution quicksort
- random pivot quick sort
- selection sort
- shell sort
- tim sort
- topological sort
- tree sort
- wiggle sort
Strings
- boyer moore search
- knuth morris pratt
- levenshtein distance
- manacher
- min cost string conversion
- naive string search
- rabin karp
Traversals
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file seanalgorithms4-0.3.tar.gz
.
File metadata
- Download URL: seanalgorithms4-0.3.tar.gz
- Upload date:
- Size: 223.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c4e398167a4e6faa6ed6c6dbd6806518c4e7d8cfd61ec0fa4988ee723a9231a |
|
MD5 | 81dd4d8c025e0b689dea0f65039a3919 |
|
BLAKE2b-256 | db99073d1746491cc596405fad5e193ade5f805ad92aacc06265fcb17a1c9471 |
File details
Details for the file seanalgorithms4-0.3-py3-none-any.whl
.
File metadata
- Download URL: seanalgorithms4-0.3-py3-none-any.whl
- Upload date:
- Size: 345.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c963844a4b23409c1c0e4835e5c2b7ac5fa7e19b87d8932abc470c2d34d65d23 |
|
MD5 | f729999a5d0d71e7bc74abb710000d74 |
|
BLAKE2b-256 | 255058b00e15e9ff1bd896f619c826bc9874ed8b24f6279883230ed3eede7286 |