Commit Graph

80 Commits

Author SHA1 Message Date
Christian Clauss
b838f1042c Fix indentation contains tabs (flake8 E101,W191) (#1573) 2019-11-15 23:05:00 -08:00
Christian Clauss
5df8aec66c
GitHub Action formats our code with psf/black (#1569)
* GitHub Action formats our code with psf/black

@poyea Your review please.

* fixup! Format Python code with psf/black push
2019-11-14 19:59:43 +01:00
Christian Clauss
fa6331aa82 Moved to TheAlgorithms/Jupyter (#1563)
https://github.com/TheAlgorithms/Jupyter/tree/master/other
2019-11-13 21:26:29 -08: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
Christian Clauss
bfac867e27
Add doctests to other/word_patterns.py (#1518) 2019-10-29 21:05:36 +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
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
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
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
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
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
akankshamahajan99
67aa3cfb4d Added alternative way to generate password in password_generator.py (#1415) 2019-10-21 22:05:12 +02:00
Archana Prabhu
313a043107 Create autocomplete_using_trie.py (#1406)
* Create autocomplete_using_trie.py

The program aims to design a trie implementation for autocomplete which is easy to understand and ready to run.

* Removed unused import

* Updated the list value

* Update autocomplete_using_trie.py

* Run the code through Black and add doctest
2019-10-20 10:40:40 +02:00
Sourav kumar
acd962b2b6 adding program to print diamond pattern (#1338)
* adding program to print diamond pattern

Written a program to print diamond pattern with stars in python 3.7

* update - changing strings to r strings
2019-10-19 00:02:32 +02:00
Swati Prajapati
8366782688 Create ActivitySelection (#1384)
* Create ActivitySelection

* Update and rename ActivitySelection to activity_selection.py

* Update activity_selection.py

* Update activity_selection.py

* Update activity_selection.py

* Update activity_selection.py

* Update activity_selection.py

* Update activity_selection.py

* Rename activity_selection.py to other/activity_selection.py

* Update activity_selection.py

* Update activity_selection.py

* Add a doctest

* print(j, end=" ")

* print(i, end=" ")

* colons

* Add trailing space
2019-10-18 23:43:33 +02:00
William Zhang
9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
Christian Clauss
47a9ea2b0b
Simplify code by dropping support for legacy Python (#1143)
* Simplify code by dropping support for legacy Python

* sort() --> sorted()
2019-08-19 15:37:49 +02:00
Christian Clauss
89acf5d017 print() is a function just like every other function (#1101)
* print() is a function just like every other function
2019-08-06 12:14:23 +02:00
Christian Clauss
a9ecdb33ca Validate Python filenames (#1086) 2019-07-30 15:32:13 +05:30
obelisk0114
46bc6738d7 Add doctest to maths/sieve_of_eratosthenes.py and remove other/finding_primes.py (#1078)
Both of the two files implemented sieve of eratosthenes.
However, there was a bug in other/finding_primes.py, and the time complexity was larger than the other.
Therefore, remove other/finding_primes.py and add doctest tomaths/sieve_of_eratosthenes.py.
2019-07-26 12:25:38 +02:00
Christian Clauss
3c8e9314b6 Travis CI: Add a flake8 test for unused imports (#1038) 2019-07-25 13:19:00 +05:30
Rakshit Parashar
0d61539883 Log_likelihood update (#1008)
* Add files via upload

This is a simple exploratory notebook that heavily expolits pandas and seaborn

* Update logistic_regression.py

* Update logistic_regression.py

* Rename Food wastage analysis from 1961-2013 (FAO).ipynb to other/Food wastage analysis from 1961-2013 (FAO).ipynb

* Update logistic_regression.py

* Update logistic_regression.py

* Update logistic_regression.py

* Update logistic_regression.py

* Update logistic_regression.py

* Update logistic_regression.py

* Update logistic_regression.py
2019-07-13 21:54:38 +02:00
Alfonso Rodríguez Pereira
5f991f7740 #315 Renamed all files to snake_case (#993) 2019-07-11 11:16:42 +02:00
cclauss
b7f13d991c Travis CI: Run black, doctest, flake8, mypy, and pytest (#964)
* Travis CI: Add type checking with mypy

* Create requirements.txt

* script: mypy --ignore-missing-stubs=cv2,numpy .

* Delete requirements.txt

* script: mypy --ignore-missing-imports .

* Run doctests

* Disable doctest -v other/detecting_english_programmatically.py

* Pytest

* No |

* pytest || true

* Run black doctest flake8 mypy pytest

* after_success: Build Directory.md

* Typo in filename: Dictionary.txt --> dictionary.txt'

Discovered via doctest run in #964

* python -m doctest -v

* pip install black flake8 mypy pytest

* pytest --doctest-glob='*.py'

* pytest --doctest-modules

* pytest --doctest-modules ./sorts

* pytest --doctest-modules ./ciphers ./other ./searches ./sorts ./strings || true

* if __name__ == "__main__":

* if __name__ == "__main__":

* if __name__ == '__main__':

* if __name__ == '__main__':

* if __name__ == '__main__':

* Create requirements.txt

* Update requirements.txt

* if __name__ == "__main__":

* Lose the doctests

* if __name__ == '__main__':

* Remove print-a-tuple

* doctest: Added missing spaces

* Update tabu_search.py

* The >>> are not doctests so change to >>)

* Travis CI: Run black, doctest, flake8, mypy, and pytest

* Link to the separate DIRECTORY.md file

* Update README.md
2019-07-08 23:27:51 +08:00
Hector S
234b0a77c4 Simplied password_generator.py (#968)
* Added print function into matrix_multiplication_addition.py and removed blank space in data_structures/binary tree directory

* Removed .vs/ folder per #893

* Rename matrix_multiplication_addition.py to matrix_operation.py

* Added main() function and simplified password generation.

* Modified password_generator.py file according to suggestions in #968
2019-07-07 17:17:38 +02:00
Anup Kumar Panwar
4e413c0183 Updated README 2019-07-06 11:11:20 +05:30
Hetal Kuvadia
831558d38d #945 Backtracking Algorithms (#953)
* Adding nqueens.py for backtracking

* Adding sum_of_subsets.py for backtracking

* Update nqueens.py

* Rename nqueens.py to n_queens.py

* Deleting /other/n_queens.py
2019-07-05 14:18:36 +05:30
PatOnTheBack
2333f93323 Change Declaration of Var 'j' to None (#921)
Since `j` is redefined before it is used, it makes more sense to declare it with the value `None` instead of `1`.

This fixes a [warning from lgtm](66c4afbd0f/files/other/primelib.py)
2019-06-30 12:41:26 +08:00
Anup Kumar Panwar
cb4be75941
Rename nqueens.py to n_queens.py 2019-05-26 22:21:22 +05:30
Anup Kumar Panwar
71be23999c refactor 2019-05-26 21:56:10 +05:30
DaveAxiom
316d5ffa37 Add NQueens backtracking search implementation (#504) 2019-05-20 04:36:46 +08:00
Lorenz Nickel
30a3582983 fix: replaced outdated url (#791)
http://www.lpb-riannetrujillo.com/blog/python-fractal/ moved to http://www.riannetrujillo.com/blog/python-fractal/
2019-05-09 03:48:30 +08:00
Mickaël Schoentgen
2d70e9f747 Fix ResourceWarning: unclosed file (#681)
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
2019-01-08 16:59:23 +08:00
Shivam Arora
768a39d832 Program for finding the HCF,LCM and Palindrome using and recursion and non recursion 2018-11-23 22:21:07 +05:30
Alex Brown
ea2ddaaf6a all valid python 3 2018-10-20 14:45:08 -05:00
Alex Brown
91fccecb56 snake_case all the things 2018-10-19 17:14:25 -05:00
Parth Shandilya
5d1f72604d
Improved Code and removed Warnings (#483) 2018-10-19 14:00:31 +05:30
Parth Shandilya
07451a6ca4
Improved Code and removed warnings (#482)
Improved Code and removed warnings
2018-10-19 13:28:21 +05:30
ParthS007
0856a61859 Remove Multiple Unused Imports and Variable 2018-10-18 02:58:57 +05:30
Syed Haseeb Shah
09088cd835
Create Fischer-Yates_Shuffle.py
The Fisher–Yates shuffle is an algorithm for generating a random permutation of a finite sequence.
For more details visit
wikipedia/Fischer-Yates-Shuffle
2018-05-19 16:07:24 +05:00
cclauss
4adf3b9492
Pass flake8 tests
Without these changes, Python syntax errors are raised.

flake8 should be run by this repo's .travis.yml file but it is currently turned off.
2018-01-06 07:54:10 +01:00
Harshil
09cc769660
Merge pull request #220 from cclauss/modernize-python2-code
Modernize Python 2 code to get ready for Python 3
2017-12-29 17:19:02 +05:30
Harshil
59dab56d58
Merge pull request #172 from ghost/master
path-1 forwarding ports with meterpreter API using namespaces with gui supported C# program. look at open ai.lnk file to see more.
2017-12-28 18:21:23 +05:30
cclauss
2ed1bad747
Merge branch 'master' into modernize-python2-code 2017-12-13 16:32:28 +01:00
cclauss
e31c780d94 Modernize Python 2 code to get ready for Python 3 2017-11-25 12:41:55 +01:00
cclauss
4e06949072 Modernize Python 2 code to get ready for Python 3 2017-11-25 10:23:50 +01:00
christianbender
50d39561e4
primelib
This python library contains some useful functions to deal with
prime numbers and whole numbers. The ideas came by the problems sets from ProjectEuler.
2017-11-18 16:29:34 +01:00
Anurag Kumar
1e9d903eca Merge pull request #3 from TheAlgorithms/master
merge from main.
2017-10-26 12:13:04 +05:30
Anurag Kumar
f1621c4a02 [other] Added Conway's Game of Life Experiment. 2017-10-26 12:11:32 +05:30
Harshil
a11d3b57b8 Merge pull request #185 from anuragkumarak95/master
[other] Added Sierpinski Triangle Generator (Fractal structure).
2017-10-26 11:30:45 +05:30