Commit Graph

1443 Commits

Author SHA1 Message Date
Du YuanChao
814750e637 update factorial (#1535)
* update factorial

* update factorial
2019-10-31 13:45:32 +01:00
Charley
80e1c8748a Added Problem 33 (#1440)
* Create sol1.py

* Create __init__.py

* Update sol1.py

* corrected range

* Update sol1.py
2019-10-31 17:50:39 +05:30
Du YuanChao
6d44cdd315 perfect square (#1534)
* perfect square

* perfect square
2019-10-31 12:33:40 +01:00
RitwickGhosh
8a5633a233 Euler Problem 27 solution script Added (#1466)
* Add files via upload

* Update DIRECTORY.md

* Create sol1.py

* Update sol1.py

* Create __init__.py

* Update DIRECTORY.md

* Delete isotonic.py

* Update sol1.py

* Problem_27_project_euler

* project_euler/Problem_27/sol1.py

* project_euler/Problem_27/sol1.py

* project_euler/problem_27/

* project_euler/problem_27

* project_euler/problem_27

* update sol1 of Euler Problem 27 solution script Added

* Remove slow test, wrap long comments, format with psf/black

* Delete __init__.py

* Add type hints

* Add doctests to function is_prime()

* Rename project_euler/problem_27/project_euler/problem_27/sol1.pysol1.py to project_euler/problem_27/problem_27_sol1.py
2019-10-31 08:19:10 +01:00
John Law
357dbd4ada
Doctest, type hints and bug in LIS_O(nlogn) (#1525)
* Update longest_increasing_subsequence_o(nlogn).py

* Update longest_increasing_subsequence_o(nlogn).py
2019-10-31 01:06:07 +08:00
percy07
df95f43907 Update quick_select.py (#1523)
* Update quick_select.py

Add Doctests.

* Add typehints

* Don't pre-allocate "smaller" and "larger"
2019-10-30 16:10:30 +01:00
Sri Suma
fc533a7598 Simplified DES (#1382)
* Simplified DES

* Add files via upload

Diffie Hellman algorithm to generate a secret key.

* Update sdes.py

* Format code with psf/black and add doctests
2019-10-30 12:52:20 +01:00
LokiUvaraj
63433616c9 average_mode.py (#1491)
* Add files via upload

Finds the mode in the input data.

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Tabs do not belong in Python files!
2019-10-30 00:26:28 +01:00
himanshujain171
53ff735701 Factors of a number (#1493)
* Factors of a number

* Update factors.py

* Fix mypy issue in basic_maths.py

* Fix mypy error in perceptron.py

* def primes(max: int) -> List[int]:

* Update binomial_heap.py

* Add a space

* Remove a space

* Add a space
2019-10-29 23:54:30 +01:00
percy07
f8e97aa597 Update basic_maths.py (#1517)
* Update basic_maths.py

Add Doctests.

* Update basic_maths.py

* Add a space to fix the doctest
2019-10-29 21:54:31 +01:00
5ur3
4880e5479a Create prime_numbers.py (#1519)
* Create prime_numbers.py

* Update prime_numbers.py
2019-10-29 21:28:51 +01:00
Christian Clauss
bfac867e27
Add doctests to other/word_patterns.py (#1518) 2019-10-29 21:05:36 +01:00
Janith Wanniarachchi
dfea6f3f0b added tests for Perceptron in Neural Networks (#1506)
*  added tests for Perceptron in Neural Networks

* Space

* Format code with psf/black
2019-10-29 11:53:29 +01:00
percy07
1ed47ad6f4 Update palindrome.py (#1509)
* Update palindrome.py

Add Doctests.

* Use test_data to drive the testing
2019-10-29 11:22:49 +01:00
percy07
e3d4d2bb57 Update greatest_common_divisor.py (#1513)
Add Doctests.
2019-10-29 11:06:37 +01:00
Kumar-Nishchay
e463c0b573 Update dictionary.txt (#1507)
Added a new word Microfinance. This is one of the recently added word in oxford dictionary
2019-10-29 14:46:29 +08:00
Devil Lord
4f86f58482 Create GAN.py (#1445)
* Create GAN.py

* gan update

* Delete train-labels-idx1-ubyte.gz

* Update GAN.py

* Update GAN.py

* Delete GAN.py

* Create gan.py

* Update gan.py

* input_data import file
2019-10-28 19:29:08 +01:00
dimgrichr
f8a30b42ce Addition of Secant Method (#876)
* Add files via upload

* Update secant_method.py

* Remove unused import

* Remove unused import
2019-10-28 19:27:00 +01:00
Phileas
3ada8bb580 Page replacement algorithm, LRU (#871)
* Page replacement algorithm, LRU

* small rectifications

* Rename paging/LRU.py to other/least_recently_used.py
2019-10-28 19:04:26 +01:00
John Law
1da1ab0773 Improve doctest and comment for maximum sub-array problem (#1503)
* Doctest and comment for maximum sub-array problem

More examples and description for max_sub_array.py

* Update max_sub_array.py

* Update max_sub_array.py

* Fix doctest
2019-10-28 17:44:57 +01:00
Du YuanChao
3fc276ca2c rename and add doctest (#1501) 2019-10-28 13:50:36 +01:00
Christian Clauss
bf50ea09ae
Add Travis_CI_tests_are_failing.md (#1499)
* Add Travis_CI_tests_are_failing.md

* Update Travis_CI_tests_are_failing.md
2019-10-28 13:38:08 +01:00
arjun1299
e36fe34b0b Hard coded inputs to mixed_keyword cypher (#1500)
* Update morse_code_implementation.py

* Delete porta_cipher.py

* Update mixed_keyword_cypher.py

* Mixed keyword cypher added

* issue with mixed keyword fixed

* no math included

* hardcoded inputs

* porta cypher added

* porta cypher added

* commented in mixed keyword according to contrib.md
2019-10-28 13:06:28 +01:00
Deekshaesha
8a5b1abd0a finding max (#1488)
* Update find_max.py

* Update find_max.py

* Format with psf/black and add doctests
2019-10-28 09:14:53 +01:00
Suad Djelili
39c40e7e40 added solution 3 for problem_25 (#1478)
* added solution 4 for problem_20

* added solution 3 for problem_25
2019-10-28 00:52:34 +01:00
Orkun İncili
8b52e44230 Python program that listing top 'n' movie in imdb (#1477)
* Python program that listing top 'n' movie in imdb

* Update get_imdbtop.py
2019-10-27 21:48:38 +01:00
Suad Djelili
a7078d7c27 added solution 4 for problem_20 (#1476) 2019-10-27 19:07:04 +01:00
ArjunwadkarAjay
bc52aa6d4d Some grammatical and spelling corrections (#1475) 2019-10-27 18:37:25 +01:00
prathmesh1199
a57809af9c Added binomial coefficient (#1467)
* Added binomial coefficient

* Format code with psf/black and add a doctest
2019-10-26 11:18:28 +02:00
Ankur Chattopadhyay
a61b05b10c minor changes in format of DIRECTORY.md (#1461) 2019-10-25 19:33:24 +02:00
Samarth Sehgal
3ea0992dc7 Update aho-corasick.py (#1457) 2019-10-25 19:05:23 +02:00
bizzfitch
182062d60b Adding deterministic miller rabin primality test (#1453)
* Adding deterministic miller rabin primality test

* Moved to ciphers directory and renamed for clarity. Changed docstring to add test
2019-10-25 19:04:06 +02:00
Samarth Sehgal
a2a3ca674f Update treap.py (#1455) 2019-10-25 17:56:27 +02:00
Isaac Gomes de Oliveira
03e9a75d69 Add gaussian_elimination.py for solving linear systems (#1448) 2019-10-25 05:56:56 +02:00
Alex Veltman
ec85cc8191 Fixes in methods and tests in Linear Algebra (#1432)
* Fixes in methods and tests

* Renamed tests.py to test_linear_algebra.py

* removed force_test()

* Delete test_linear_algebra.py

* Format code with psf/black

* Rename tests.py to test_linear_algebra.py
2019-10-24 12:39:51 +02:00
Alex Veltman
07483139d1 Added determinate function (#1429)
* Added determinate function

* Changed determinate function name

* Changed instance of .det() to .determinate()

* Added force_test() function

* Update tests.py
2019-10-24 11:08:45 +02:00
praisearts
7b3d385ad6 create simple binary search (#1430)
* create simnple binary search

#A binary search implementation to test if a number is in a list of elements

* Add .py, format with psf/black, and add doctests
2019-10-24 10:31:58 +02:00
Ankur Chattopadhyay
d477a4ddf2 introduced shuffled_shift_cipher.py in /ciphers (#1424)
* introduced shuffled_shift_cipher.py in /ciphers

* made requested changes

* introduced doctests, type hints
removed __make_one_digit()

* test_end_to_end() inserted

* Make test_end_to_end() a test ;-)
2019-10-23 20:20:38 +02:00
John Law
56830255ca
Readability of CONTRIBUTING.md (#1422)
* Readability of guidelines

* Update README.md
2019-10-23 04:07:50 +08:00
Matheus T. Guimarães
5fd868c460 Add algorithm to rotate images (#1420)
* Add algorithm to rotate image

* Edit function to be compliant in Black and Flake8 formats

* Add type hints in get_rotation() and  enumerate() in loop
2019-10-22 21:19:38 +02:00
Ankur Chattopadhyay
7592cba417 psf/black code formatting (#1421)
* added sol3.py for problem_20

* added sol4.py for problem_06

* ran `black .` on `\Python`
2019-10-22 19:13:48 +02:00
Ankur Chattopadhyay
11e2207182 Project Euler problems 06, 20 (#1419)
* added sol3.py for problem_20

* added sol4.py for problem_06
2019-10-22 18:02:03 +02:00
Daniel Melo
906c985de3 Create dinic.py (#1396)
* Create dinic.py

Dinic's algorithm for maximum flow

* Update dinic.py

Changes made.
2019-10-22 11:37:43 +02:00
Ghulam Mohiyuddin
7444a1f069 Another method added for GCD (#1387)
* Another method added for GCD

* Now doctest fulfilled for added method.

* Update greatest_common_divisor.py

* Now unnecessary white spaces removed.

* Cycle_Detection_Undirected_Graph

Cycle_Detection_Undirected_Graph using Disjoint set DataStructure

* Update greatest_common_divisor.py again

* Again Updated cycle_detection_undirected_graph.py

* Delete cycle_detection_undirected_graph.py

* Add doctests and format the code with psf/black

* fixup: Typo

* Update greatest_common_divisor.py

* greatest_common_divisor()
2019-10-22 11:26:06 +02:00
DanishSheikh1999
13802fcca1 Create greedy.py (#1359)
* Create greedy.py

* Update greedy.py

* Add a doctest and format with black

* Update build_directory_md.py
2019-10-22 10:55:01 +02:00
Anmol Jain
54830644a2 Create newton_forward_interpolation.py (#333)
* Create newton_forward_interpolation.py

This code is for calculating newton forward difference interpolation for fixed difference.

* Add doctests and reformat with black
2019-10-22 10:01:14 +02:00
Aashay Shingre
92268561a5 Aho-Corasick String Matching Algorithm (#346)
* add aho-corasick algorithm

* Add a doctest and format with black
2019-10-22 09:42:56 +02:00
Suad Djelili
8b572e6cfd added solution 7 for problem_01 (#1416)
* added solution 7 for problem_01

* added solution 5 for problem_02
2019-10-22 09:31:17 +02:00
anubhav-sharma13
ce7faa5a3a Largest subarray sum (#1404)
* Insertion_sort

* largest subarray sum

* updated print command

* removed extraspaces

* removed sys.maxint

* added explaination

* Updated function style

* Update largest_subarray_sum.py

* Update i_sort.py

* Delete bogo_bogo_sort.py
2019-10-22 09:30:11 +02:00
Christian Clauss
4531ea425e
Transfer .ipynb files to TheAlgorithms/Jupyter (#1414) 2019-10-22 08:45:03 +02:00