Commit Graph

101 Commits

Author SHA1 Message Date
Christian Clauss
9316e7c014
Set the Python file maximum line length to 88 characters (#2122)
* flake8 --max-line-length=88

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-06-16 10:09:19 +02:00
Christian Clauss
1f8a21d727
Tighten up psf/black and flake8 (#2024)
* Tighten up psf/black and flake8

* Fix some tests

* Fix some E741

* Fix some E741

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-05-22 08:10:11 +02:00
Sanders Lin
777ddca2e9
Update fast_fibonacci.py (#1889)
* Update fast_fibonacci.py

* Update fast_fibonacci.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-05-19 19:31:52 +02:00
Christian Clauss
6acd7fb5ce
Wrap lines that go beyond GitHub Editor (#1925)
* Wrap lines that go beyond GiHub Editor

* flake8 --count --select=E501 --max-line-length=127

* updating DIRECTORY.md

* Update strassen_matrix_multiplication.py

* fixup! Format Python code with psf/black push

* Update decision_tree.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-05-01 23:36:35 +02:00
Sanders Lin
1c9d4a3929
Update abbreviation.py (#1887) 2020-04-17 20:04:30 +02:00
matkosoric
7f04e5cd34
contribution guidelines checks (#1787)
* spelling corrections

* review

* improved documentation, removed redundant variables, added testing

* added type hint

* camel case to snake case

* spelling fix

* review

* python --> Python # it is a brand name, not a snake

* explicit cast to int

* spaces in int list

* "!= None" to "is not None"

* Update comb_sort.py

* various spelling corrections in documentation & several variables naming conventions fix

* + char in file name

* import dependency - bug fix

Co-authored-by: John Law <johnlaw.po@gmail.com>
2020-03-04 13:40:28 +01:00
Christian Clauss
652b891a75
Travis CI: Upgrade to Python 3.8 (#1783)
* Travis CI: Upgrade to Python 3.8

* updating DIRECTORY.md

* Tensorflow is not yet compatible with Python 3.8

* Disable k_means_clustering_tensorflow.py

* updating DIRECTORY.md

* Disable gan.py

* updating DIRECTORY.md

* Disable input_data.py

* updating DIRECTORY.md

* pip install a current version of six
2020-02-23 04:23:00 +01:00
onlinejudge95
4866b1330b
Fixes black failures from Previous PR (#1751)
* Fixes black failures from Previous PR

* Fixes equality testing alert

* Fixes call to main() alert

* Fixes unused import
2020-02-13 02:19:41 +05:30
Jimmy Y
1096aa2336
Added DP Solution for Optimal BST Problem (#1740)
* Added code to dynamic_programming directory

* Added doctest

* Elaborated BST

* Small tweaks

* Update optimal_bst.py

* Some touchups

* Fixed doctest

* Update optimal_bst.py

* Update optimal_bst.py

* Update optimal_bst.py

* Rename optimal_bst.py to optimal_binary_search_tree.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-02-11 05:53:26 +01:00
onlinejudge95
6fdd53c676
Fixes LGTM issues (#1745)
* Fixes redefinition of a variable

* Fixes implementing __eq__

* Updates docstring
2020-02-10 22:23:19 +01:00
Christian Clauss
bfcb95b297
Create codespell.yml (#1698)
* fixup! Format Python code with psf/black push

* Create codespell.yml

* fixup! Format Python code with psf/black push
2020-01-18 13:24:33 +01:00
Christian Clauss
28419cf839 pyupgrade --py37-plus **/*.py (#1654)
* pyupgrade --py37-plus **/*.py

* fixup! Format Python code with psf/black push
2020-01-03 22:25:36 +08:00
Christian Clauss
34c808b375 actions/checkout@v2 (#1643)
* actions/checkout@v2

https://github.com/actions/checkout/releases

* fixup! Format Python code with psf/black push
2019-12-26 19:50:12 +08:00
faizan2700
86dbf0a9d3 file iterating_through_submasks.py for given mask is added in dynamic_programming (#1635)
* new file *iterating_through_submasks* is added in dynamic_programming section

* no changes

* *iterating_through_submasks.py is added in dynamic_programming

* iterating_through_submasks is added with doctests

* iterating_through_submasks.py is added in dynamic_programming

* changes made in *iterating_through_submasks.py

* changes made in *iterating_through_submasks.py

* updated
2019-12-18 19:55:12 +05:30
Iqrar Agalosi Nureyza
1af4c02ba6 adding doctests on coin_change.py and fixed some typos (#1337)
* adding doctests on coin_change.py

* fixed some typos

* Update lib.py
2019-12-18 08:35:03 +01:00
GeorgeChambi
9eb50cc223 Improved readability (#1615)
* improved readability

* further readability improvements

* removed csv file and added f
2019-12-07 06:39:59 +01:00
Arun Babu PT
c5fd075f1e Fractional knapsack (#1524)
* Add files via upload

* Added doctests, type hints, f-strings, URLs

* Rename knapsack.py to fractional_knapsack.py

* Rename graphs/fractional_knapsack.py to dynamic_programming/fractional_knapsack_2.py
2019-11-22 22:55:19 +08:00
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
John Law
a9d5378ce2
Doctest and typing for longest_increasing_subsequence.py (#1526)
* Update longest_increasing_subsequence.py

* Update longest_increasing_subsequence.py

* Format longest_increasing_subsequence.py to PEP8

* Update longest_increasing_subsequence.py
2019-11-05 02:06:16 +08:00
Taufik Algi F
c717f8d860 add max sum contigous subsequence (#1537)
* add max sum contigous subsequence

* fix typo

* Add doctest and type hints

* Create autoblack.yml
2019-10-31 18:45:01 +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
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
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
Jigyasa G
ddb094919b Adding doctests for fractional_knapsack.py (#1331)
* Adding doctests for fractional_knapsack.py

* Update fractional_knapsack.py
2019-10-18 08:13:20 +02:00
Jigyasa G
67291a5bce Modified longest_common_ssubsequence.py for successful doctests (#1332) 2019-10-12 02:32:41 +08:00
Jigyasa G
e678879892 Adding doctests for sum_of_subset.py (#1333) 2019-10-12 02:29:50 +08:00
Jigyasa G
ea47ae2932 Adding missing Doctests (#1330)
* Adding doctests in abbreviation

* Adding doctests in fibonacci.py
2019-10-10 00:20:19 +05:00
William Zhang
9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
Maxwell Aladago
2dfe01e4d8 Fully refactored the rod cutting module. (#1169)
* changing typo

* fully refactored the rod-cutting module

* more documentations

* rewording
2019-09-05 08:22:06 +02:00
Rwithik Manoj
d4151bd516 Fix possible error in longest_common_subsequence.py (#1163)
The comparison at line 53 was not checking if (j > 0).
2019-08-31 13:40:50 +02: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
Maxwell Aladago
32aa7ff081 ENH: refactored longest common subsequence, also fixed a bug with the sequence returned (#1142)
* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* some pep8 cleanup too

* ENH: refactored longest common subsequence, also fixed a bug with the sequence returned

* renamed function
2019-08-19 09:40:36 +02:00
Maxwell Aladago
5d46a4dd7b ENH: Added a functionality to make it possible to reconstruct an optimal subset for the dynamic programming problem (#1139)
* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* function for the knapsack problem which returns one of the optimal subsets

* some pep8 cleanup too
2019-08-19 07:39:39 +02:00
Sanders Lin
f64b602938 Update max_sub_array.py (#1000)
* Update max_sub_array.py

added another method of computing maximum sum subarray

* Update max_sub_array.py

* Update max_sub_array.py
2019-07-17 18:12:24 +02:00
Jigyasa G
f195d9251c adding factorial (#930)
* adding factorial

* adding doctest

* Update factorial.py
2019-07-17 08:22:08 +02:00
cclauss
2fb3beeaf1 Fix error message and format with python/black (#1025)
@SandersLin Your review please?
2019-07-16 10:56:28 +05:30
Sanders Lin
1e55bfd4da Create climbing_stairs.py (#1002)
a simple dp problem seen on LeetCode:  https://leetcode.com/problems/climbing-stairs/
2019-07-15 18:17:41 +02:00
Sanders Lin
7271c0d64a Update rod_cutting.py (#995)
* Update rod_cutting.py

A hopefully clearer implementation without dependence on global variables.

* Update rod_cutting.py

added doctests

* Update rod_cutting.py

* Update rod_cutting.py
2019-07-13 09:12:54 +02:00
Sanders Lin
7a6ebb85a2 Update edit_distance.py (#1001)
added bottom up method.
2019-07-13 09:10:02 +02:00
Alfonso Rodríguez Pereira
5f991f7740 #315 Renamed all files to snake_case (#993) 2019-07-11 11:16:42 +02:00
cclauss
e6eaa078e2
Pytest the entire repo (#980)
* Pytest the entire repo

* Do each directory for now...

* YAML files hate tabs

* Add more requirements

* pip install opencv-python

* Comment out FTP

* Add pandas and sklearn to requirements

* Comment out FTP, graphs, machine_learning, maths, neural_network, project_euler

* Update .travis.yml

* Comment out Data structures

* if __name__ == "__main__":

* pytest --ignore=

* pytest .

* Update .travis.yml

* pytest . --doctest-modules --ignore=${IGNORE}

* Ignore --ignore because it just hangs
2019-07-10 06:59:39 +02:00
Jigyasa G
65a12fa317 Adding sum of subsets (#929) 2019-07-02 23:23:35 +08:00
Ambuj81
7f4f565e62 subset_generation (#326)
* subset_generation

generate all possible subset of size n of a given array of size r

* Rename subset_generation to subset_generation.py

* Update subset_generation.py

I made all changes I could  . What I mean is I removed all the empty space ....... 
There some comment extra if you feel removing those comments please do so yourself pls provide spacing as it should be

* Create morse_Code_implementation.py

* Any more changes pls let me know
2019-05-26 22:07:40 +05:30
Anup Kumar Panwar
71be23999c refactor 2019-05-26 21:56:10 +05:30
Aditya Haridas Menon
bb29dc55fa Bitmasking and DP added (#705) 2019-03-28 01:59:31 +08:00
pradyotd
98a149e41e Update coin_change.py (#706)
Cleanup PEP-8 , additional comments , using coin_val, instead of range and index.
2019-02-21 00:54:26 +08:00
Anthony Marakis
dc302be505 Create rod_cutting.py (#373) 2019-02-09 08:27:23 +05:30
Ashwek Swamy
39912aed57 Update max_sub_array.py (#597) 2018-11-05 09:31:00 +01:00
Benedikt Werner
6db1994de2 Remove unnecessary loop in matrix_chain_order.py (#564) 2018-10-31 08:31:49 +01:00