Commit Graph

30 Commits

Author SHA1 Message Date
Guillaume Rochedix
d95d643351
Heaps algorithm (#2475)
* heaps_algorithm: new algo

* typo

* correction doctest

* doctests: compare with itertools.permutations

* doctest: sorted instead of set

* doctest

* doctest

* rebuild
2020-09-29 12:39:07 +02:00
Guillaume Rochedix
04322e67e5
Heaps algorithm iterative (#2505)
* heap's algorithm iterative

* doctest

* doctest

* rebuild
2020-09-29 12:38:12 +02:00
Dhruv
48357cea5b
Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
Christian Clauss
9200a2e543
from __future__ import annotations (#2464)
* from __future__ import annotations

* fixup! from __future__ import annotations

* fixup! from __future__ import annotations

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-09-23 13:30:13 +02:00
Du Yuanchao
4d0a8f2355
Optimized recursive_bubble_sort (#2410)
* optimized recursive_bubble_sort

* Fixed doctest error due whitespace

* reduce loop times for optimization

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-09-10 10:31:26 +02:00
Christian Clauss
b9e5259aeb
Fix long line, tests (#2123)
* Fix long line

* updating DIRECTORY.md

* Add doctest

* ...

* ...

* Update tabu_search.py

* space

* Fix doctest

    >>> find_neighborhood(['a','c','b','d','e','a'])  # doctest: +NORMALIZE_WHITESPACE
    [['a','e','b','d','c','a',90], [['a','c','d','b','e','a',90],
     ['a','d','b','c','e','a',93], ['a','c','b','e','d','a',102],
     ['a','c','e','d','b','a',113], ['a','b','c','d','e','a',93]]

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
2020-06-16 14:29:13 +02:00
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
Ekansh Mangal
025b1a6989
Merge sort Update variable names (#2032)
* Update Merge sort variable names

* Update mergesort.py

* Update mergesort.py

* black

* Update mergesort.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-05-24 08:38:43 +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
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
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
onlinejudge95
2cb6a6523e
Corrects failing check in master (#1676) 2020-01-12 14:58:47 +05:30
AlexLeka98
98733618e2 Added Strassen divide and conquer algorithm to multiply matrices. (#1648)
* Added Strassen divide and conquer algorithm to multiply matrices

* Divide and conquer algorith to calculate pow(a,b) or a raised to the power of b

* Putting docstring inside the function.

* Added doctests
2020-01-12 09:34:10 +05:30
ELNS
43905efe29 Adding doctests into LDA algorithm (#1621)
* Adding doctests into <gaussian_distribution> function

* Adding doctests into <y_generator> function

* Adding doctests into <calculate_mean> function

* Adding doctests into <calculate_probabilities> function

* Adding doctests into <calculate_variance> function

* Adding doctests into <predict_y_values> function

* Adding doctests into <accuracy> function

* fixup! Format Python code with psf/black push

* Update convex_hull.py

* Update convex_hull.py
2019-12-08 23:15:17 +01:00
Christian Clauss
26b0803319
Simplify sudoku.is_completed() using builtin all() (#1608)
* Simplify sudoku.is_completed() using builtin all()

Simplify __sudoku.is_completed()__ using Python builtin function [__all()__](https://docs.python.org/3/library/functions.html#all).

* fixup! Format Python code with psf/black push

* Update sudoku.py

* fixup! Format Python code with psf/black push

* Old style exception -> new style for Python 3

* updating DIRECTORY.md

* Update convex_hull.py

* fixup! Format Python code with psf/black push

* e.args[0] = "msg"

* ValueError: could not convert string to float: 'pi'

* Update convex_hull.py

* fixup! Format Python code with psf/black push
2019-12-08 22:42:17 +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
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
b6cc37d461 mergesort added (#1313)
* mergesort added

* added doctest
2019-10-10 00:12:09 +05:00
William Zhang
9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
Denis Trofimov
04962c0d17 Fix lgtm error display #1024 (#1190)
* fix: Syntax Error lgtm display in matrix/matrix_operation.py.

* Testing for None should use the 'is' operator.

* fix: Too many arguments for string format.

* fix: supress lgtm alert as false positive.

* style: Unnecessary 'pass' statement.

* Revert "fix: Syntax Error lgtm display in matrix/matrix_operation.py."

This reverts commit 4c629b4ce1.
2019-09-21 16:23:34 +02:00
Maxwell Aladago
a4ed40be86 changing typo (#1168) 2019-09-04 22:06:44 +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
05c9a05f36 ENH: two algorithms for the convex hull problem of a set of 2d points on a plain (#1135)
* divide and conquer and brute force algorithms for array-inversions counting

* divide and conquer and brute force algorithms for array-inversions counting

* divide and conquer and brute force algorithms for array-inversions counting

* a naive and divide-and-conquer algorithms for the convex-hull problem

* two convex-hull algorithms, a divide-and-conquer and a naive algorithm

* two convex-hull algorithms, a divide-and-conquer and a naive algorithm

* two convex-hull algorithms, a divide-and-conquer and a naive algorithm
2019-08-17 17:36:31 +02:00
Maxwell Aladago
5bdcd4836c EHN: A divide-and-conquer, and brute-force algorithms for array inversions co… (#1133)
* divide and conquer and brute force algorithms for array-inversions counting

* divide and conquer and brute force algorithms for array-inversions counting

* divide and conquer and brute force algorithms for array-inversions counting
2019-08-15 20:07:43 +02:00
Harshil
762482dc40 Update closest_pair_of_points.py (#1109) 2019-08-06 21:31:03 +02:00
rsun0013
58126406fd pytests for closest_pair_of_points.py (#1099)
added some tests to the file
2019-08-06 11:17:17 +02:00
Dharni0607
c85312da89 updates in closest pair of points algorithm (#979)
* updated closest pair of points (n*(logn)^2) to (n*logn)
2019-07-09 19:50:43 +04:30
Erfan Alimohammadi
781b7f86e7 Fix readme and duplicate (#967)
* Fix typo

* Add all_permutations algorithm to backtracking directory

* Update backtracking and D&C algorithms in README

Update backtracking and divide_and_conquer algorithms in README

* Remove the duplicated file
2019-07-06 20:02:06 +05:30
Dharni0607
035457f569 closest pair of points algo (#943)
* created divide_and_conquer folder and added max_sub_array_sum.py under it (issue #817)

* additional file in divide_and_conqure (closest pair of points)
2019-07-04 12:19:14 +04:30
Dharni0607
0f56ab5c3c Divide and conquer Algorithms Issue#817 (#938)
* add ons in string directory - Bayer_Moore_Search

* created divide_and_conquer folder and added max_sub_array_sum.py under it (issue #817)
2019-07-02 16:50:25 +04:30