From 01121afa65ed6a175a3e976515ed604e90a1623f Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Tue, 17 Dec 2019 22:44:44 +0530 Subject: [PATCH 01/15] new file *iterating_through_submasks* is added in dynamic_programming section --- .../iterating_through_submasks.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dynamic_programming/iterating_through_submasks.py diff --git a/dynamic_programming/iterating_through_submasks.py b/dynamic_programming/iterating_through_submasks.py new file mode 100644 index 000000000000..4957caecae2a --- /dev/null +++ b/dynamic_programming/iterating_through_submasks.py @@ -0,0 +1,46 @@ +''' +You are given a bitmask m and you want to efficiently iterate through all of +its submasks. The mask s is submask of m if only bits that were included in +bitmask are set +''' + +def list_of_submasks(mask)->list: + + """ + Args: + mask : number which shows mask ( always integer > 0, zero does not have any submasks ) + + Returns: + all_submasks : the list of submasks of mask (mask s is called submask of mask + m if only bits that were included in original mask are set + + Raises: + AssertionError: mask not positive integer + + >>> list_of_submasks(15) + [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] + >>> list_of_submasks(13) + [13, 12, 9, 8, 5, 4, 1] + + """ + + fmt = "n needs to be positive integer, your input {}" + assert isinstance(mask, int) and mask > 0, fmt.format(mask) + + ''' + first submask iterated will be mask itself then operation will be performed + to get other submasks till we reach empty submask that is zero ( zero is not + included in final submasks list ) + ''' + all_submasks = [] + submask = mask + + while submask: + all_submasks.append(submask) + submask = (submask-1) & mask + + return all_submasks + +if __name__ == '__main__': + import doctest + doctest.testmod() From ac5b41ca40b4713619b836b513c0116ddcc33848 Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Tue, 17 Dec 2019 22:48:50 +0530 Subject: [PATCH 02/15] no changes --- .../iterating_through_submasks.py | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 dynamic_programming/iterating_through_submasks.py diff --git a/dynamic_programming/iterating_through_submasks.py b/dynamic_programming/iterating_through_submasks.py deleted file mode 100644 index 4957caecae2a..000000000000 --- a/dynamic_programming/iterating_through_submasks.py +++ /dev/null @@ -1,46 +0,0 @@ -''' -You are given a bitmask m and you want to efficiently iterate through all of -its submasks. The mask s is submask of m if only bits that were included in -bitmask are set -''' - -def list_of_submasks(mask)->list: - - """ - Args: - mask : number which shows mask ( always integer > 0, zero does not have any submasks ) - - Returns: - all_submasks : the list of submasks of mask (mask s is called submask of mask - m if only bits that were included in original mask are set - - Raises: - AssertionError: mask not positive integer - - >>> list_of_submasks(15) - [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] - >>> list_of_submasks(13) - [13, 12, 9, 8, 5, 4, 1] - - """ - - fmt = "n needs to be positive integer, your input {}" - assert isinstance(mask, int) and mask > 0, fmt.format(mask) - - ''' - first submask iterated will be mask itself then operation will be performed - to get other submasks till we reach empty submask that is zero ( zero is not - included in final submasks list ) - ''' - all_submasks = [] - submask = mask - - while submask: - all_submasks.append(submask) - submask = (submask-1) & mask - - return all_submasks - -if __name__ == '__main__': - import doctest - doctest.testmod() From 6e484d8e7ca1cd13af0c6e901d8a23d34acf2ae5 Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Tue, 17 Dec 2019 22:56:06 +0530 Subject: [PATCH 03/15] *iterating_through_submasks.py is added in dynamic_programming --- .../iterating_through_submasks.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dynamic_programming/iterating_through_submasks.py diff --git a/dynamic_programming/iterating_through_submasks.py b/dynamic_programming/iterating_through_submasks.py new file mode 100644 index 000000000000..4957caecae2a --- /dev/null +++ b/dynamic_programming/iterating_through_submasks.py @@ -0,0 +1,46 @@ +''' +You are given a bitmask m and you want to efficiently iterate through all of +its submasks. The mask s is submask of m if only bits that were included in +bitmask are set +''' + +def list_of_submasks(mask)->list: + + """ + Args: + mask : number which shows mask ( always integer > 0, zero does not have any submasks ) + + Returns: + all_submasks : the list of submasks of mask (mask s is called submask of mask + m if only bits that were included in original mask are set + + Raises: + AssertionError: mask not positive integer + + >>> list_of_submasks(15) + [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] + >>> list_of_submasks(13) + [13, 12, 9, 8, 5, 4, 1] + + """ + + fmt = "n needs to be positive integer, your input {}" + assert isinstance(mask, int) and mask > 0, fmt.format(mask) + + ''' + first submask iterated will be mask itself then operation will be performed + to get other submasks till we reach empty submask that is zero ( zero is not + included in final submasks list ) + ''' + all_submasks = [] + submask = mask + + while submask: + all_submasks.append(submask) + submask = (submask-1) & mask + + return all_submasks + +if __name__ == '__main__': + import doctest + doctest.testmod() From 00351ca8992cc9b8a959274861a25d19123e81ba Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Wed, 18 Dec 2019 10:27:19 +0530 Subject: [PATCH 04/15] iterating_through_submasks is added with doctests --- .../iterating_through_submasks.py | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/dynamic_programming/iterating_through_submasks.py b/dynamic_programming/iterating_through_submasks.py index 4957caecae2a..d855dbe47518 100644 --- a/dynamic_programming/iterating_through_submasks.py +++ b/dynamic_programming/iterating_through_submasks.py @@ -1,10 +1,13 @@ -''' +""" +Author : Syed Faizan (3rd Year Student IIIT Pune) +github : faizan2700 You are given a bitmask m and you want to efficiently iterate through all of its submasks. The mask s is submask of m if only bits that were included in bitmask are set -''' +""" -def list_of_submasks(mask)->list: + +def list_of_submasks(mask) -> list: """ Args: @@ -21,26 +24,36 @@ def list_of_submasks(mask)->list: [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] >>> list_of_submasks(13) [13, 12, 9, 8, 5, 4, 1] + >>> list_of_submasks(-7) # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + AssertionError: mask needs to be positive integer, your input -7 + >>> list_of_submasks(0) # doctest: +ELLIPSIS + Traceback (most recent call last): + ... + AssertionError: mask needs to be positive integer, your input 0 """ fmt = "n needs to be positive integer, your input {}" assert isinstance(mask, int) and mask > 0, fmt.format(mask) - - ''' + + """ first submask iterated will be mask itself then operation will be performed to get other submasks till we reach empty submask that is zero ( zero is not included in final submasks list ) - ''' + """ all_submasks = [] submask = mask while submask: all_submasks.append(submask) - submask = (submask-1) & mask - + submask = (submask - 1) & mask + return all_submasks -if __name__ == '__main__': + +if __name__ == "__main__": import doctest + doctest.testmod() From b3946094a78e1ccbcddf80130082ef76a0e000d0 Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Wed, 18 Dec 2019 10:38:21 +0530 Subject: [PATCH 05/15] iterating_through_submasks.py is added in dynamic_programming --- dynamic_programming/iterating_through_submasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic_programming/iterating_through_submasks.py b/dynamic_programming/iterating_through_submasks.py index d855dbe47518..f33052b28917 100644 --- a/dynamic_programming/iterating_through_submasks.py +++ b/dynamic_programming/iterating_through_submasks.py @@ -35,7 +35,7 @@ def list_of_submasks(mask) -> list: """ - fmt = "n needs to be positive integer, your input {}" + fmt = "mask needs to be positive integer, your input {}" assert isinstance(mask, int) and mask > 0, fmt.format(mask) """ From 9f4f23948d1441b5a6ff76de0bf9f8eba4dd3f1e Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Wed, 18 Dec 2019 15:19:45 +0530 Subject: [PATCH 06/15] changes made in *iterating_through_submasks.py --- diff | 578 ++++++++++++++++++ dynamic_programming/checking request.py | 1 + .../iterating_through_submasks.py | 3 +- 3 files changed, 581 insertions(+), 1 deletion(-) create mode 100644 diff create mode 100644 dynamic_programming/checking request.py diff --git a/diff b/diff new file mode 100644 index 000000000000..49ce64441717 --- /dev/null +++ b/diff @@ -0,0 +1,578 @@ +commit b3946094a78e1ccbcddf80130082ef76a0e000d0 (HEAD -> master, origin/master, origin/HEAD) +Author: faizan2700 +Date: Wed Dec 18 10:38:21 2019 +0530 + + iterating_through_submasks.py is added in dynamic_programming + +commit 00351ca8992cc9b8a959274861a25d19123e81ba +Author: faizan2700 +Date: Wed Dec 18 10:27:19 2019 +0530 + + iterating_through_submasks is added with doctests + +commit 6e484d8e7ca1cd13af0c6e901d8a23d34acf2ae5 +Author: faizan2700 +Date: Tue Dec 17 22:56:06 2019 +0530 + + *iterating_through_submasks.py is added in dynamic_programming + +commit ac5b41ca40b4713619b836b513c0116ddcc33848 +Author: faizan2700 +Date: Tue Dec 17 22:48:50 2019 +0530 + + no changes + +commit 01121afa65ed6a175a3e976515ed604e90a1623f +Author: faizan2700 +Date: Tue Dec 17 22:44:44 2019 +0530 + + new file *iterating_through_submasks* is added in dynamic_programming section + +commit f4779bc04ae706b0c548e2fe6d7a59efe8b85524 +Author: Rohit Joshi <34398948+rohitjoshi21@users.noreply.github.com> +Date: Sun Dec 15 13:12:07 2019 +0545 + + Bug Fixed in newton_raphson_method.py (#1634) + + * Bug Fixed + + * Fixed newton_raphson_method.py + + * Fixed newton_raphson_method.py 2 + + * Fixed newton_raphson_method.py 3 + + * Fixed newton_raphson_method.py 4 + + * Fixed newton_raphson_method.py 5 + + * Fixed newton_raphson_method.py 6 + + * Update newton_raphson_method.py + + * Update newton_raphson_method.py + + * # noqa: F401, F403 + + * newton_raphson + + * newton_raphson + + * precision: int=10 ** -10 + + * return float(x) + + * 3.1415926536808043 + + * Update newton_raphson_method.py + + * 2.23606797749979 + + * Update newton_raphson_method.py + + * Rename newton_raphson_method.py to newton_raphson.py + +commit bc5b92f7f9de09bbaba96cd7fc8b2853dc0c080c +Author: Muhammad Ibtihaj Naeem +Date: Sat Dec 14 10:46:02 2019 +0500 + + Harmonic Geometric and P-Series Added (#1633) + + * Harmonic Geometric and P-Series Added + + * Editing comments + + * Update and rename series/Geometric_Series.py to maths/series/geometric_series.py + + * Update and rename series/Harmonic_Series.py to maths/series/harmonic_series.py + + * Update and rename series/P_Series.py to maths/series/p_series.py + +commit d385472c6fe5abda18759f89e81efe1f0bf6da0f +Author: heartsmoking <327899144@qq.com> +Date: Wed Dec 11 14:57:08 2019 +0800 + + Update find_min.py (#1627) + + Line 5: :return: max number in list + "max" must be "min" + +commit b9bff8f3a72427b5d2ae3f2f174dc5db11df0d50 +Author: Christian Clauss +Date: Tue Dec 10 15:53:50 2019 +0100 + + Remove \r from strings (#1622) + + * Remove \r from strings + + * Satisfy tensorflow with numpy>=1.17.4 + +commit 1cbeaa252ad5822c9197b385a99e550f7aa2f897 +Author: Binish Manandhar <37204996+binish784@users.noreply.github.com> +Date: Tue Dec 10 12:37:40 2019 +0545 + + Image processing algorithms added (#616) + + * Image processing algorithms added + + * Example images included + + * Issues resolved + + * class added + + * Naming issues fixes + + * Create file_path + +commit 9316618611967c26b98ce275fab238f735f2864e +Author: Shoaib Asgar +Date: Mon Dec 9 07:59:01 2019 +0530 + + digital_image_processing/convert_to_negative (#1216) + + * digital_image_processing/convert_to_negative + + * added doc + + * added test code + + * Update convert_to_negative.py + +commit 02b717e364cd6623e303d4cc2378d1448779dc2b +Author: Samarth Sehgal +Date: Mon Dec 9 09:43:56 2019 +1100 + + Update odd_even_transposition_parallel.py (#1458) + + * Update odd_even_transposition_parallel.py + + * arr = OddEvenTransposition(arr) + +commit 74d96ab3558120b6810aa3f613e091774aefeca3 +Author: Jawpral <34590600+Jawpral@users.noreply.github.com> +Date: Mon Dec 9 03:57:42 2019 +0530 + + Fixed issue #1368 (#1482) + + * Changed as suggested + + Now return in same format as oct() returns + + * Slight change + + * Fixed issue #1368, return values for large number now is fixed and does not return in scientific notation + + * Update decimal_to_octal.py + +commit 43905efe298172e9e9280661d80af8f7e2105517 +Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> +Date: Mon Dec 9 01:45:17 2019 +0330 + + Adding doctests into LDA algorithm (#1621) + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * fixup! Format Python code with psf/black push + + * Update convex_hull.py + + * Update convex_hull.py + +commit 26b0803319b6cf14f623769356c79343e3d43d14 +Author: Christian Clauss +Date: Sun Dec 8 22:42:17 2019 +0100 + + 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 + +commit 9eb50cc223f7a8da8d7299bf4db8e4d3313b8bff +Author: GeorgeChambi +Date: Sat Dec 7 05:39:59 2019 +0000 + + Improved readability (#1615) + + * improved readability + + * further readability improvements + + * removed csv file and added f + +commit 938dd0bbb5145aa7c60127745ae0571cb20a2387 +Author: Níkolas Vargas +Date: Sat Dec 7 02:39:08 2019 -0300 + + improved prime numbers implementation (#1606) + + * improved prime numbers implementation + + * fixup! Format Python code with psf/black push + + * fix type hint + + * fixup! Format Python code with psf/black push + + * fix doctests + + * updating DIRECTORY.md + + * added prime tests with negative numbers + + * using for instead filter + + * updating DIRECTORY.md + + * Remove unused typing.List + + * Remove tab indentation + + * print("Sorted order is:", " ".join(a)) + +commit ccc1ff2ce89af2a569f1fbfa16ff70ad22ed9e89 +Author: SHAKTI SINGH +Date: Fri Dec 6 12:04:21 2019 +0530 + + pigeonhole sorting in python (#364) + + * pigeonhole sorting in python + + * variable name update in pigeonhole_sort.py + + * Add doctest + +commit 3cfca42f17e4e5f3d31da30eb80f7c0baa66eb4b +Author: João Gustavo A. Amorim +Date: Fri Dec 6 03:13:10 2019 -0300 + + add the index calculation class at digital_image_processing and the hamming code algorithm at hashes (#1152) + + * add the index calculation at difital_image_processing file + + * make changes at index_calculation + + * update the variables to self variables at functions + + * update the word wrap in comments at index_calculation + + * add the hamming code algorithm + + * Wrap long lines + +commit 494fb4fb490c49d46c693933c5583ac2fb4f665b +Author: Bardia Alavi +Date: Wed Dec 4 23:06:41 2019 -0500 + + address merge_soft duplicate files (#1612) + + Here the old file merge_sort_fastest is renamed to unknown_sort. Because it is not merge sort algorithm. + + Comments are updated accordingly. + +commit caad74466aaa6a98465e10bd7adf828482d2de63 +Author: QuantumNovice <43876848+QuantumNovice@users.noreply.github.com> +Date: Tue Dec 3 16:17:42 2019 +0500 + + Added Multilayer Perceptron (sklearn) (#1609) + + * Added Multilayer Perceptron ( sklearn) + + * Rename MLPClassifier.py to multilayer_preceptron_classifier.py + + * Rename multilayer_preceptron_classifier.py to multilayer_perceptron_classifier.py + + * Update multilayer_perceptron_classifier.py + +commit 8ffc4f8706dc5ecb7cd015839f1cb92997217c63 +Author: GeorgeChambi +Date: Tue Dec 3 11:14:30 2019 +0000 + + fixed bug (#1610) + + Removed comma from print statement causing and error. + +commit 74aeaa333f81912b696e0cf069e4993bc94113cc +Author: Abhijit Patil +Date: Sun Dec 1 11:28:25 2019 +0530 + + Code for Eulers Totient function (#1229) + + * Create eulersTotient.py + + * Rename eulersTotient.py to eulers_totient.py + + * Update eulers_totient.py + +commit 4dca9571dba5b6d0ce31fe49e8928451573a34af +Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> +Date: Sun Dec 1 02:29:23 2019 -0300 + + Pythagoras (#1243) + + * add pythagoras.py + + * function distance + + * run as script + + * Update pythagoras.py + +commit 415c9f5e6547457eb3546b467283cbd9e82e4eec +Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> +Date: Sun Dec 1 02:13:28 2019 -0300 + + Improve prim.py (#1226) + + * suiting PEP8 + + * create auxiliary function + + * running example + + * updating DIRECTORY.md + +commit 5d20dbfb98a19634db0961318f5378f50e94c428 +Author: Saurabh Goyal +Date: Sat Nov 30 10:47:13 2019 +0530 + + add a generic heap (#906) + + * add a generic heap + + * Delete __init__.py + + * Rename data_structures/Heap/heap_generic.py to data_structures/heap/heap_generic.py + + * Add doctests + + * Fix doctests + + * Fix doctests again + +commit 2fb6f786ceff9fef94494d73d541a4e7e5feafed +Author: Christian Clauss +Date: Thu Nov 28 19:53:37 2019 +0100 + + Typo in a comment (#1603) + +commit f4a7c5066c1921842a158976e349b4c6a6955d72 +Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> +Date: Thu Nov 28 19:51:34 2019 +0330 + + converting generator object to a list object (#1602) + + * converting generator object to a list object + + * Refactor: converting generator object to a list object + + * fixup! Format Python code with psf/black push + +commit 4baf3972e1fc8b8e366e509762e4731bb158f0f5 +Author: Christian Clauss +Date: Wed Nov 27 11:30:21 2019 +0100 + + GitHub Action to mark stale issues and pull requests (#1594) + +commit 140b79b4b2a184e041ce2e50e503d7a87b235b68 +Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> +Date: Tue Nov 26 15:27:53 2019 +0330 + + Adding Linear Discriminant Analysis (#1592) + + * Adding new file to the machine_learning directory + + * Adding initial documentation + + * importing modules + + * Adding Normal_gen function + + * Adding Y_gen function + + * Adding mean_calc function + + * Adding prob_calc function + + * Adding var_calc function + + * Adding predict function + + * Adding accuracy function + + * Adding main function + + * Renaming LDA file + + * Adding requested changes + + * Renaming some of functions + + * Refactoring str.format() statements to f-string + + * Removing unnecessary list objects inside two functions + + * changing code style in some lines + + * Fixing y_generator function + + * Refactoring 'predict_y_values' function by using list comprehensions + + * Changing code style in import statements + + * Refactoring CLI code block + + * fixup! Format Python code with psf/black push + + * No lines longer than 88 characters + +commit 0d3c9d586ca3e4642aa88e1bbf88a008993e0019 +Author: Vikas Kumar <54888022+vikasit12@users.noreply.github.com> +Date: Tue Nov 26 11:15:28 2019 +0530 + + Update singly_linked_list.py (#1593) + + * Update singly_linked_list.py + + printing current.data rather than node address in __repr__ for a more readable print statement + + * eval(repr(c)) == c + + The output of `__repr__()` _should look like a valid Python expression that could be used to recreate an object with the same value_. + + https://docs.python.org/3.4/reference/datamodel.html#object.__repr__ + + * += --> + + +commit 2ad5a1f0836f9d8b8da77457f163a183d98a0bda +Author: achance6 <45263295+achance6@users.noreply.github.com> +Date: Sat Nov 23 10:52:32 2019 -0500 + + Implemented simple keyword cipher (#1589) + + * Implemented simple keyword cipher + + * Added documentation and improved input processing + + * Allow object's hash function to be called + + * added to string functionality + + * reverted + + * Revised according to pull request #1589 + + * Optimized imports + + * Update simple_keyword_cypher.py + + * Update hash_table.py + +commit 4c75f863c84e049026135d5ae04e6969fc569add +Author: vansh bhardwaj <39709733+vansh1999@users.noreply.github.com> +Date: Sat Nov 23 18:24:06 2019 +0530 + + added current stock price (#1590) + + * added current stock price + + * Ten lines or less + +commit e09bf696488b83b090330c1baaf51ec938ed2d3a +Author: BryanChan777 <43082778+BryanChan777@users.noreply.github.com> +Date: Fri Nov 22 19:06:52 2019 -0800 + + Update README.md (#1588) + + * Update README.md + + * python -m unittest -v + +commit c5fd075f1ea9b6dc11cca2d36605aaddbd0ab5fa +Author: Arun Babu PT <36483987+ptarun@users.noreply.github.com> +Date: Fri Nov 22 20:25:19 2019 +0530 + + 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 + +commit ec7bc7c7cde95afbc8a7d7f826358cc221edfb6b +Author: Christian Clauss +Date: Thu Nov 21 15:21:40 2019 +0100 + + Tabs --> spaces in quine_mc_cluskey.py (#1426) + + * Tabs --> spaces in quine_mc_cluskey.py + + * fixup! Format Python code with psf/black push + +commit e8aa81297a6291a7d0994d71605f07d654aae17c +Author: Fakher Mokadem +Date: Wed Nov 20 06:36:32 2019 +0100 + + Update gaussian_filter.py (#1548) + + * Update gaussian_filter.py + + Changed embedded for loops with product. This way range(dst_height) is called only once, instead of being called $dst_height. + + * Update gaussian_filter.py + + fixed missing width + +commit 28c02a1f21b07627c98dd38e2cb933c1b9c14c6c +Author: John Law +Date: Tue Nov 19 13:52:55 2019 -0800 + + Improve bellman_ford.py (#1575) + + * Fix out of range error in bellman_ford.py + + * Update bellman_ford.py + + * fixup! Format Python code with psf/black push + + * Enhance the print function + + * fixup! Format Python code with psf/black push diff --git a/dynamic_programming/checking request.py b/dynamic_programming/checking request.py new file mode 100644 index 000000000000..799f4a7fe946 --- /dev/null +++ b/dynamic_programming/checking request.py @@ -0,0 +1 @@ +import request diff --git a/dynamic_programming/iterating_through_submasks.py b/dynamic_programming/iterating_through_submasks.py index f33052b28917..edeacc3124fa 100644 --- a/dynamic_programming/iterating_through_submasks.py +++ b/dynamic_programming/iterating_through_submasks.py @@ -5,9 +5,10 @@ its submasks. The mask s is submask of m if only bits that were included in bitmask are set """ +from typing import List -def list_of_submasks(mask) -> list: +def list_of_submasks(mask: int) -> List[int]: """ Args: From e4686e3a177b87bfe28984129176efbd0950ae0f Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Wed, 18 Dec 2019 15:26:36 +0530 Subject: [PATCH 07/15] changes made in *iterating_through_submasks.py --- dynamic_programming/checking request.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 dynamic_programming/checking request.py diff --git a/dynamic_programming/checking request.py b/dynamic_programming/checking request.py deleted file mode 100644 index 799f4a7fe946..000000000000 --- a/dynamic_programming/checking request.py +++ /dev/null @@ -1 +0,0 @@ -import request From 73456f85de03782b7d3c794eca8390a4fe87037c Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Wed, 18 Dec 2019 15:33:45 +0530 Subject: [PATCH 08/15] updated --- diff | 578 ----------------------------------------------------------- 1 file changed, 578 deletions(-) delete mode 100644 diff diff --git a/diff b/diff deleted file mode 100644 index 49ce64441717..000000000000 --- a/diff +++ /dev/null @@ -1,578 +0,0 @@ -commit b3946094a78e1ccbcddf80130082ef76a0e000d0 (HEAD -> master, origin/master, origin/HEAD) -Author: faizan2700 -Date: Wed Dec 18 10:38:21 2019 +0530 - - iterating_through_submasks.py is added in dynamic_programming - -commit 00351ca8992cc9b8a959274861a25d19123e81ba -Author: faizan2700 -Date: Wed Dec 18 10:27:19 2019 +0530 - - iterating_through_submasks is added with doctests - -commit 6e484d8e7ca1cd13af0c6e901d8a23d34acf2ae5 -Author: faizan2700 -Date: Tue Dec 17 22:56:06 2019 +0530 - - *iterating_through_submasks.py is added in dynamic_programming - -commit ac5b41ca40b4713619b836b513c0116ddcc33848 -Author: faizan2700 -Date: Tue Dec 17 22:48:50 2019 +0530 - - no changes - -commit 01121afa65ed6a175a3e976515ed604e90a1623f -Author: faizan2700 -Date: Tue Dec 17 22:44:44 2019 +0530 - - new file *iterating_through_submasks* is added in dynamic_programming section - -commit f4779bc04ae706b0c548e2fe6d7a59efe8b85524 -Author: Rohit Joshi <34398948+rohitjoshi21@users.noreply.github.com> -Date: Sun Dec 15 13:12:07 2019 +0545 - - Bug Fixed in newton_raphson_method.py (#1634) - - * Bug Fixed - - * Fixed newton_raphson_method.py - - * Fixed newton_raphson_method.py 2 - - * Fixed newton_raphson_method.py 3 - - * Fixed newton_raphson_method.py 4 - - * Fixed newton_raphson_method.py 5 - - * Fixed newton_raphson_method.py 6 - - * Update newton_raphson_method.py - - * Update newton_raphson_method.py - - * # noqa: F401, F403 - - * newton_raphson - - * newton_raphson - - * precision: int=10 ** -10 - - * return float(x) - - * 3.1415926536808043 - - * Update newton_raphson_method.py - - * 2.23606797749979 - - * Update newton_raphson_method.py - - * Rename newton_raphson_method.py to newton_raphson.py - -commit bc5b92f7f9de09bbaba96cd7fc8b2853dc0c080c -Author: Muhammad Ibtihaj Naeem -Date: Sat Dec 14 10:46:02 2019 +0500 - - Harmonic Geometric and P-Series Added (#1633) - - * Harmonic Geometric and P-Series Added - - * Editing comments - - * Update and rename series/Geometric_Series.py to maths/series/geometric_series.py - - * Update and rename series/Harmonic_Series.py to maths/series/harmonic_series.py - - * Update and rename series/P_Series.py to maths/series/p_series.py - -commit d385472c6fe5abda18759f89e81efe1f0bf6da0f -Author: heartsmoking <327899144@qq.com> -Date: Wed Dec 11 14:57:08 2019 +0800 - - Update find_min.py (#1627) - - Line 5: :return: max number in list - "max" must be "min" - -commit b9bff8f3a72427b5d2ae3f2f174dc5db11df0d50 -Author: Christian Clauss -Date: Tue Dec 10 15:53:50 2019 +0100 - - Remove \r from strings (#1622) - - * Remove \r from strings - - * Satisfy tensorflow with numpy>=1.17.4 - -commit 1cbeaa252ad5822c9197b385a99e550f7aa2f897 -Author: Binish Manandhar <37204996+binish784@users.noreply.github.com> -Date: Tue Dec 10 12:37:40 2019 +0545 - - Image processing algorithms added (#616) - - * Image processing algorithms added - - * Example images included - - * Issues resolved - - * class added - - * Naming issues fixes - - * Create file_path - -commit 9316618611967c26b98ce275fab238f735f2864e -Author: Shoaib Asgar -Date: Mon Dec 9 07:59:01 2019 +0530 - - digital_image_processing/convert_to_negative (#1216) - - * digital_image_processing/convert_to_negative - - * added doc - - * added test code - - * Update convert_to_negative.py - -commit 02b717e364cd6623e303d4cc2378d1448779dc2b -Author: Samarth Sehgal -Date: Mon Dec 9 09:43:56 2019 +1100 - - Update odd_even_transposition_parallel.py (#1458) - - * Update odd_even_transposition_parallel.py - - * arr = OddEvenTransposition(arr) - -commit 74d96ab3558120b6810aa3f613e091774aefeca3 -Author: Jawpral <34590600+Jawpral@users.noreply.github.com> -Date: Mon Dec 9 03:57:42 2019 +0530 - - Fixed issue #1368 (#1482) - - * Changed as suggested - - Now return in same format as oct() returns - - * Slight change - - * Fixed issue #1368, return values for large number now is fixed and does not return in scientific notation - - * Update decimal_to_octal.py - -commit 43905efe298172e9e9280661d80af8f7e2105517 -Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> -Date: Mon Dec 9 01:45:17 2019 +0330 - - Adding doctests into LDA algorithm (#1621) - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * fixup! Format Python code with psf/black push - - * Update convex_hull.py - - * Update convex_hull.py - -commit 26b0803319b6cf14f623769356c79343e3d43d14 -Author: Christian Clauss -Date: Sun Dec 8 22:42:17 2019 +0100 - - 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 - -commit 9eb50cc223f7a8da8d7299bf4db8e4d3313b8bff -Author: GeorgeChambi -Date: Sat Dec 7 05:39:59 2019 +0000 - - Improved readability (#1615) - - * improved readability - - * further readability improvements - - * removed csv file and added f - -commit 938dd0bbb5145aa7c60127745ae0571cb20a2387 -Author: Níkolas Vargas -Date: Sat Dec 7 02:39:08 2019 -0300 - - improved prime numbers implementation (#1606) - - * improved prime numbers implementation - - * fixup! Format Python code with psf/black push - - * fix type hint - - * fixup! Format Python code with psf/black push - - * fix doctests - - * updating DIRECTORY.md - - * added prime tests with negative numbers - - * using for instead filter - - * updating DIRECTORY.md - - * Remove unused typing.List - - * Remove tab indentation - - * print("Sorted order is:", " ".join(a)) - -commit ccc1ff2ce89af2a569f1fbfa16ff70ad22ed9e89 -Author: SHAKTI SINGH -Date: Fri Dec 6 12:04:21 2019 +0530 - - pigeonhole sorting in python (#364) - - * pigeonhole sorting in python - - * variable name update in pigeonhole_sort.py - - * Add doctest - -commit 3cfca42f17e4e5f3d31da30eb80f7c0baa66eb4b -Author: João Gustavo A. Amorim -Date: Fri Dec 6 03:13:10 2019 -0300 - - add the index calculation class at digital_image_processing and the hamming code algorithm at hashes (#1152) - - * add the index calculation at difital_image_processing file - - * make changes at index_calculation - - * update the variables to self variables at functions - - * update the word wrap in comments at index_calculation - - * add the hamming code algorithm - - * Wrap long lines - -commit 494fb4fb490c49d46c693933c5583ac2fb4f665b -Author: Bardia Alavi -Date: Wed Dec 4 23:06:41 2019 -0500 - - address merge_soft duplicate files (#1612) - - Here the old file merge_sort_fastest is renamed to unknown_sort. Because it is not merge sort algorithm. - - Comments are updated accordingly. - -commit caad74466aaa6a98465e10bd7adf828482d2de63 -Author: QuantumNovice <43876848+QuantumNovice@users.noreply.github.com> -Date: Tue Dec 3 16:17:42 2019 +0500 - - Added Multilayer Perceptron (sklearn) (#1609) - - * Added Multilayer Perceptron ( sklearn) - - * Rename MLPClassifier.py to multilayer_preceptron_classifier.py - - * Rename multilayer_preceptron_classifier.py to multilayer_perceptron_classifier.py - - * Update multilayer_perceptron_classifier.py - -commit 8ffc4f8706dc5ecb7cd015839f1cb92997217c63 -Author: GeorgeChambi -Date: Tue Dec 3 11:14:30 2019 +0000 - - fixed bug (#1610) - - Removed comma from print statement causing and error. - -commit 74aeaa333f81912b696e0cf069e4993bc94113cc -Author: Abhijit Patil -Date: Sun Dec 1 11:28:25 2019 +0530 - - Code for Eulers Totient function (#1229) - - * Create eulersTotient.py - - * Rename eulersTotient.py to eulers_totient.py - - * Update eulers_totient.py - -commit 4dca9571dba5b6d0ce31fe49e8928451573a34af -Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> -Date: Sun Dec 1 02:29:23 2019 -0300 - - Pythagoras (#1243) - - * add pythagoras.py - - * function distance - - * run as script - - * Update pythagoras.py - -commit 415c9f5e6547457eb3546b467283cbd9e82e4eec -Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> -Date: Sun Dec 1 02:13:28 2019 -0300 - - Improve prim.py (#1226) - - * suiting PEP8 - - * create auxiliary function - - * running example - - * updating DIRECTORY.md - -commit 5d20dbfb98a19634db0961318f5378f50e94c428 -Author: Saurabh Goyal -Date: Sat Nov 30 10:47:13 2019 +0530 - - add a generic heap (#906) - - * add a generic heap - - * Delete __init__.py - - * Rename data_structures/Heap/heap_generic.py to data_structures/heap/heap_generic.py - - * Add doctests - - * Fix doctests - - * Fix doctests again - -commit 2fb6f786ceff9fef94494d73d541a4e7e5feafed -Author: Christian Clauss -Date: Thu Nov 28 19:53:37 2019 +0100 - - Typo in a comment (#1603) - -commit f4a7c5066c1921842a158976e349b4c6a6955d72 -Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> -Date: Thu Nov 28 19:51:34 2019 +0330 - - converting generator object to a list object (#1602) - - * converting generator object to a list object - - * Refactor: converting generator object to a list object - - * fixup! Format Python code with psf/black push - -commit 4baf3972e1fc8b8e366e509762e4731bb158f0f5 -Author: Christian Clauss -Date: Wed Nov 27 11:30:21 2019 +0100 - - GitHub Action to mark stale issues and pull requests (#1594) - -commit 140b79b4b2a184e041ce2e50e503d7a87b235b68 -Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> -Date: Tue Nov 26 15:27:53 2019 +0330 - - Adding Linear Discriminant Analysis (#1592) - - * Adding new file to the machine_learning directory - - * Adding initial documentation - - * importing modules - - * Adding Normal_gen function - - * Adding Y_gen function - - * Adding mean_calc function - - * Adding prob_calc function - - * Adding var_calc function - - * Adding predict function - - * Adding accuracy function - - * Adding main function - - * Renaming LDA file - - * Adding requested changes - - * Renaming some of functions - - * Refactoring str.format() statements to f-string - - * Removing unnecessary list objects inside two functions - - * changing code style in some lines - - * Fixing y_generator function - - * Refactoring 'predict_y_values' function by using list comprehensions - - * Changing code style in import statements - - * Refactoring CLI code block - - * fixup! Format Python code with psf/black push - - * No lines longer than 88 characters - -commit 0d3c9d586ca3e4642aa88e1bbf88a008993e0019 -Author: Vikas Kumar <54888022+vikasit12@users.noreply.github.com> -Date: Tue Nov 26 11:15:28 2019 +0530 - - Update singly_linked_list.py (#1593) - - * Update singly_linked_list.py - - printing current.data rather than node address in __repr__ for a more readable print statement - - * eval(repr(c)) == c - - The output of `__repr__()` _should look like a valid Python expression that could be used to recreate an object with the same value_. - - https://docs.python.org/3.4/reference/datamodel.html#object.__repr__ - - * += --> + - -commit 2ad5a1f0836f9d8b8da77457f163a183d98a0bda -Author: achance6 <45263295+achance6@users.noreply.github.com> -Date: Sat Nov 23 10:52:32 2019 -0500 - - Implemented simple keyword cipher (#1589) - - * Implemented simple keyword cipher - - * Added documentation and improved input processing - - * Allow object's hash function to be called - - * added to string functionality - - * reverted - - * Revised according to pull request #1589 - - * Optimized imports - - * Update simple_keyword_cypher.py - - * Update hash_table.py - -commit 4c75f863c84e049026135d5ae04e6969fc569add -Author: vansh bhardwaj <39709733+vansh1999@users.noreply.github.com> -Date: Sat Nov 23 18:24:06 2019 +0530 - - added current stock price (#1590) - - * added current stock price - - * Ten lines or less - -commit e09bf696488b83b090330c1baaf51ec938ed2d3a -Author: BryanChan777 <43082778+BryanChan777@users.noreply.github.com> -Date: Fri Nov 22 19:06:52 2019 -0800 - - Update README.md (#1588) - - * Update README.md - - * python -m unittest -v - -commit c5fd075f1ea9b6dc11cca2d36605aaddbd0ab5fa -Author: Arun Babu PT <36483987+ptarun@users.noreply.github.com> -Date: Fri Nov 22 20:25:19 2019 +0530 - - 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 - -commit ec7bc7c7cde95afbc8a7d7f826358cc221edfb6b -Author: Christian Clauss -Date: Thu Nov 21 15:21:40 2019 +0100 - - Tabs --> spaces in quine_mc_cluskey.py (#1426) - - * Tabs --> spaces in quine_mc_cluskey.py - - * fixup! Format Python code with psf/black push - -commit e8aa81297a6291a7d0994d71605f07d654aae17c -Author: Fakher Mokadem -Date: Wed Nov 20 06:36:32 2019 +0100 - - Update gaussian_filter.py (#1548) - - * Update gaussian_filter.py - - Changed embedded for loops with product. This way range(dst_height) is called only once, instead of being called $dst_height. - - * Update gaussian_filter.py - - fixed missing width - -commit 28c02a1f21b07627c98dd38e2cb933c1b9c14c6c -Author: John Law -Date: Tue Nov 19 13:52:55 2019 -0800 - - Improve bellman_ford.py (#1575) - - * Fix out of range error in bellman_ford.py - - * Update bellman_ford.py - - * fixup! Format Python code with psf/black push - - * Enhance the print function - - * fixup! Format Python code with psf/black push From 7a2ef8d9b8a71f54fed24a8c1c13f325ae3808a6 Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Thu, 19 Dec 2019 23:52:54 +0530 Subject: [PATCH 09/15] *other/integeration_by_simpson_approx.py added --- DIRECTORY.md | 4 +- other/integeration_by_simpson_approx.py | 129 ++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 other/integeration_by_simpson_approx.py diff --git a/DIRECTORY.md b/DIRECTORY.md index 468fe65298d9..690cef8a85a9 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -171,7 +171,8 @@ * [Rod Cutting](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/rod_cutting.py) * [Subset Generation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/subset_generation.py) * [Sum Of Subset](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/sum_of_subset.py) - + * [Submask of Mask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/iterating_through_submasks.py) + ## File Transfer * [Recieve File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/recieve_file.py) * [Send File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/send_file.py) @@ -352,6 +353,7 @@ * [Tower Of Hanoi](https://github.com/TheAlgorithms/Python/blob/master/other/tower_of_hanoi.py) * [Two Sum](https://github.com/TheAlgorithms/Python/blob/master/other/two_sum.py) * [Word Patterns](https://github.com/TheAlgorithms/Python/blob/master/other/word_patterns.py) + * [Integeration](https://github.com/TheAlgorithms/Python/blob/master/other/integeration_by_simpson_approx.py) ## Project Euler * Problem 01 diff --git a/other/integeration_by_simpson_approx.py b/other/integeration_by_simpson_approx.py new file mode 100644 index 000000000000..dcc1a1345f31 --- /dev/null +++ b/other/integeration_by_simpson_approx.py @@ -0,0 +1,129 @@ +""" +Author : Syed Faizan ( 3rd Year IIIT Pune ) +Github : faizan2700 + +Purpose : You have one function f(x) which takes float integer and returns +float you have to integrate the function in limits a to b. +The approximation proposed by Thomas Simpsons in 1743 is one way to calculate integration. + +( read article : https://cp-algorithms.com/num_methods/simpson-integration.html ) + +simpson_integration() takes function,lower_limit=a,upper_limit=b,precision and +returns the integration of function in given limit. +""" + +# constants +# the more the number of steps the more accurate +N_STEPS = 1000 + + +def f(x: float) -> float: + return x * x + + +""" +Summary of Simpson Approximation : + +By simpsons integration : +1.integration of fxdx with limit a to b is = f(x0) + 4 * f(x1) + 2 * f(x2) + 4 * f(x3) + 2 * f(x4)..... + f(xn) +where x0 = a +xi = a + i * h +xn = b +""" + + +def simpson_integration(function, a: float, b: float, precision: int = 4) -> float: + + """ + Args: + function : the function which's integration is desired + a : the lower limit of integration + b : upper limit of integraion + precision : precision of the result,error required default is 4 + + Returns: + result : the value of the approximated integration of function in range a to b + + Raises: + AssertionError: function is not callable + AssertionError: a is not float or integer + AssertionError: function should return float or integer + AssertionError: b is not float or integer + AssertionError: precision is not positive integer + + >>> simpson_integration(lambda x : x*x,1,2,3) + 2.333 + + >>> simpson_integration(lambda x : x*x,'wrong_input',2,3) + Traceback (most recent call last): + ... + AssertionError: a should be float or integer your input : wrong_input + + >>> simpson_integration(lambda x : x*x,1,'wrong_input',3) + Traceback (most recent call last): + ... + AssertionError: b should be float or integer your input : wrong_input + + >>> simpson_integration(lambda x : x*x,1,2,'wrong_input') + Traceback (most recent call last): + ... + AssertionError: precision should be positive integer your input : wrong_input + >>> simpson_integration('wrong_input',2,3,4) + Traceback (most recent call last): + ... + AssertionError: the function(object) passed should be callable your input : wrong_input + + >>> simpson_integration(lambda x : x*x,3.45,3.2,1) + -2.8 + + >>> simpson_integration(lambda x : x*x,3.45,3.2,0) + Traceback (most recent call last): + ... + AssertionError: precision should be positive integer your input : 0 + + >>> simpson_integration(lambda x : x*x,3.45,3.2,-1) + Traceback (most recent call last): + ... + AssertionError: precision should be positive integer your input : -1 + + """ + assert callable( + function + ), "the function(object) passed should be callable your input : {}".format(function) + assert isinstance(a, float) or isinstance( + a, int + ), "a should be float or integer your input : {}".format(a) + assert isinstance(function(a), float) or isinstance( + function(a), int + ), "the function should return integer or float return type of your function, {}".format( + type(function(a)) + ) + assert isinstance(b, float) or isinstance( + b, int + ), "b should be float or integer your input : {}".format(b) + assert ( + isinstance(precision, int) and precision > 0 + ), "precision should be positive integer your input : {}".format(precision) + + # just applying the formula of simpson for approximate integraion written in + # mentioned article in first comment of this file and above this function + + h = (b - a) / N_STEPS + result = function(a) + function(b) + + for i in range(1, N_STEPS): + a1 = a + h * i + + if i % 2: + result += function(a1) * 4 + else: + result += function(a1) * 2 + + result *= h / 3 + return round(result, precision) + + +if __name__ == "__main__": + import doctest + + doctest.testmod() From a909958efaf8435d7f39627310bb19b8199ba2ed Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Thu, 19 Dec 2019 23:59:00 +0530 Subject: [PATCH 10/15] *other/integeration_by_simpson_approx.py Added for integeration --- DIRECTORY.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 690cef8a85a9..b3f534952436 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -147,6 +147,7 @@ ## Dynamic Programming * [Abbreviation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/abbreviation.py) + * [All Submasks of Mask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/iterating_through_submasks.py) * [Bitmask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/bitmask.py) * [Climbing Stairs](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/climbing_stairs.py) * [Coin Change](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/coin_change.py) @@ -171,8 +172,7 @@ * [Rod Cutting](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/rod_cutting.py) * [Subset Generation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/subset_generation.py) * [Sum Of Subset](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/sum_of_subset.py) - * [Submask of Mask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/iterating_through_submasks.py) - + ## File Transfer * [Recieve File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/recieve_file.py) * [Send File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/send_file.py) @@ -340,6 +340,7 @@ * [Frequency Finder](https://github.com/TheAlgorithms/Python/blob/master/other/frequency_finder.py) * [Game Of Life](https://github.com/TheAlgorithms/Python/blob/master/other/game_of_life.py) * [Greedy](https://github.com/TheAlgorithms/Python/blob/master/other/greedy.py) + * [Integeration](https://github.com/TheAlgorithms/Python/blob/master/other/integeration_by_simpson_approx.py) * [Largest Subarray Sum](https://github.com/TheAlgorithms/Python/blob/master/other/largest_subarray_sum.py) * [Least Recently Used](https://github.com/TheAlgorithms/Python/blob/master/other/least_recently_used.py) * [Linear Congruential Generator](https://github.com/TheAlgorithms/Python/blob/master/other/linear_congruential_generator.py) @@ -353,7 +354,6 @@ * [Tower Of Hanoi](https://github.com/TheAlgorithms/Python/blob/master/other/tower_of_hanoi.py) * [Two Sum](https://github.com/TheAlgorithms/Python/blob/master/other/two_sum.py) * [Word Patterns](https://github.com/TheAlgorithms/Python/blob/master/other/word_patterns.py) - * [Integeration](https://github.com/TheAlgorithms/Python/blob/master/other/integeration_by_simpson_approx.py) ## Project Euler * Problem 01 From 081ccdf65b8a94c029d220842d6fc7c4a2b5a61f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 19 Dec 2019 21:48:45 +0100 Subject: [PATCH 11/15] Delete iterating_through_submasks.py --- .../iterating_through_submasks.py | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 dynamic_programming/iterating_through_submasks.py diff --git a/dynamic_programming/iterating_through_submasks.py b/dynamic_programming/iterating_through_submasks.py deleted file mode 100644 index edeacc3124fa..000000000000 --- a/dynamic_programming/iterating_through_submasks.py +++ /dev/null @@ -1,60 +0,0 @@ -""" -Author : Syed Faizan (3rd Year Student IIIT Pune) -github : faizan2700 -You are given a bitmask m and you want to efficiently iterate through all of -its submasks. The mask s is submask of m if only bits that were included in -bitmask are set -""" -from typing import List - - -def list_of_submasks(mask: int) -> List[int]: - - """ - Args: - mask : number which shows mask ( always integer > 0, zero does not have any submasks ) - - Returns: - all_submasks : the list of submasks of mask (mask s is called submask of mask - m if only bits that were included in original mask are set - - Raises: - AssertionError: mask not positive integer - - >>> list_of_submasks(15) - [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] - >>> list_of_submasks(13) - [13, 12, 9, 8, 5, 4, 1] - >>> list_of_submasks(-7) # doctest: +ELLIPSIS - Traceback (most recent call last): - ... - AssertionError: mask needs to be positive integer, your input -7 - >>> list_of_submasks(0) # doctest: +ELLIPSIS - Traceback (most recent call last): - ... - AssertionError: mask needs to be positive integer, your input 0 - - """ - - fmt = "mask needs to be positive integer, your input {}" - assert isinstance(mask, int) and mask > 0, fmt.format(mask) - - """ - first submask iterated will be mask itself then operation will be performed - to get other submasks till we reach empty submask that is zero ( zero is not - included in final submasks list ) - """ - all_submasks = [] - submask = mask - - while submask: - all_submasks.append(submask) - submask = (submask - 1) & mask - - return all_submasks - - -if __name__ == "__main__": - import doctest - - doctest.testmod() From 8ddae3427ae7c1b737505e4ec999f7a28f8970cc Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 19 Dec 2019 21:49:09 +0100 Subject: [PATCH 12/15] Delete DIRECTORY.md --- DIRECTORY.md | 552 --------------------------------------------------- 1 file changed, 552 deletions(-) delete mode 100644 DIRECTORY.md diff --git a/DIRECTORY.md b/DIRECTORY.md deleted file mode 100644 index b3f534952436..000000000000 --- a/DIRECTORY.md +++ /dev/null @@ -1,552 +0,0 @@ - -## Arithmetic Analysis - * [Bisection](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/bisection.py) - * [Gaussian Elimination](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/gaussian_elimination.py) - * [In Static Equilibrium](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/in_static_equilibrium.py) - * [Intersection](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/intersection.py) - * [Lu Decomposition](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/lu_decomposition.py) - * [Newton Forward Interpolation](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_forward_interpolation.py) - * [Newton Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_method.py) - * [Newton Raphson Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_raphson_method.py) - * [Secant Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/secant_method.py) - -## Backtracking - * [All Combinations](https://github.com/TheAlgorithms/Python/blob/master/backtracking/all_combinations.py) - * [All Permutations](https://github.com/TheAlgorithms/Python/blob/master/backtracking/all_permutations.py) - * [All Subsequences](https://github.com/TheAlgorithms/Python/blob/master/backtracking/all_subsequences.py) - * [Minimax](https://github.com/TheAlgorithms/Python/blob/master/backtracking/minimax.py) - * [N Queens](https://github.com/TheAlgorithms/Python/blob/master/backtracking/n_queens.py) - * [Sudoku](https://github.com/TheAlgorithms/Python/blob/master/backtracking/sudoku.py) - * [Sum Of Subsets](https://github.com/TheAlgorithms/Python/blob/master/backtracking/sum_of_subsets.py) - -## Blockchain - * [Chinese Remainder Theorem](https://github.com/TheAlgorithms/Python/blob/master/blockchain/chinese_remainder_theorem.py) - * [Diophantine Equation](https://github.com/TheAlgorithms/Python/blob/master/blockchain/diophantine_equation.py) - * [Modular Division](https://github.com/TheAlgorithms/Python/blob/master/blockchain/modular_division.py) - -## Boolean Algebra - * [Quine Mc Cluskey](https://github.com/TheAlgorithms/Python/blob/master/boolean_algebra/quine_mc_cluskey.py) - -## Ciphers - * [Affine Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/affine_cipher.py) - * [Atbash](https://github.com/TheAlgorithms/Python/blob/master/ciphers/atbash.py) - * [Base16](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base16.py) - * [Base32](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base32.py) - * [Base64 Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base64_cipher.py) - * [Base85](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base85.py) - * [Brute Force Caesar Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/brute_force_caesar_cipher.py) - * [Caesar Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/caesar_cipher.py) - * [Cryptomath Module](https://github.com/TheAlgorithms/Python/blob/master/ciphers/cryptomath_module.py) - * [Deterministic Miller Rabin](https://github.com/TheAlgorithms/Python/blob/master/ciphers/deterministic_miller_rabin.py) - * [Diffie](https://github.com/TheAlgorithms/Python/blob/master/ciphers/diffie.py) - * [Elgamal Key Generator](https://github.com/TheAlgorithms/Python/blob/master/ciphers/elgamal_key_generator.py) - * [Hill Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/hill_cipher.py) - * [Mixed Keyword Cypher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/mixed_keyword_cypher.py) - * [Morse Code Implementation](https://github.com/TheAlgorithms/Python/blob/master/ciphers/morse_code_implementation.py) - * [Onepad Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/onepad_cipher.py) - * [Playfair Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/playfair_cipher.py) - * [Porta Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/porta_cipher.py) - * [Rabin Miller](https://github.com/TheAlgorithms/Python/blob/master/ciphers/rabin_miller.py) - * [Rot13](https://github.com/TheAlgorithms/Python/blob/master/ciphers/rot13.py) - * [Rsa Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/rsa_cipher.py) - * [Rsa Factorization](https://github.com/TheAlgorithms/Python/blob/master/ciphers/rsa_factorization.py) - * [Rsa Key Generator](https://github.com/TheAlgorithms/Python/blob/master/ciphers/rsa_key_generator.py) - * [Shuffled Shift Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/shuffled_shift_cipher.py) - * [Simple Keyword Cypher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/simple_keyword_cypher.py) - * [Simple Substitution Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/simple_substitution_cipher.py) - * [Trafid Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/trafid_cipher.py) - * [Transposition Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/transposition_cipher.py) - * [Transposition Cipher Encrypt Decrypt File](https://github.com/TheAlgorithms/Python/blob/master/ciphers/transposition_cipher_encrypt_decrypt_file.py) - * [Vigenere Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/vigenere_cipher.py) - * [Xor Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/xor_cipher.py) - -## Compression - * [Burrows Wheeler](https://github.com/TheAlgorithms/Python/blob/master/compression/burrows_wheeler.py) - * [Huffman](https://github.com/TheAlgorithms/Python/blob/master/compression/huffman.py) - * [Peak Signal To Noise Ratio](https://github.com/TheAlgorithms/Python/blob/master/compression/peak_signal_to_noise_ratio.py) - -## Conversions - * [Decimal To Binary](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_binary.py) - * [Decimal To Hexadecimal](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_hexadecimal.py) - * [Decimal To Octal](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_octal.py) - -## Data Structures - * Binary Tree - * [Avl Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/avl_tree.py) - * [Basic Binary Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/basic_binary_tree.py) - * [Binary Search Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/binary_search_tree.py) - * [Fenwick Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/fenwick_tree.py) - * [Lazy Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/lazy_segment_tree.py) - * [Lca](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/lca.py) - * [Non Recursive Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/non_recursive_segment_tree.py) - * [Red Black Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/red_black_tree.py) - * [Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/segment_tree.py) - * [Treap](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/treap.py) - * Data Structures - * Heap - * [Heap Generic](https://github.com/TheAlgorithms/Python/blob/master/data_structures/data_structures/heap/heap_generic.py) - * Disjoint Set - * [Disjoint Set](https://github.com/TheAlgorithms/Python/blob/master/data_structures/disjoint_set/disjoint_set.py) - * Hashing - * [Double Hash](https://github.com/TheAlgorithms/Python/blob/master/data_structures/hashing/double_hash.py) - * [Hash Table](https://github.com/TheAlgorithms/Python/blob/master/data_structures/hashing/hash_table.py) - * [Hash Table With Linked List](https://github.com/TheAlgorithms/Python/blob/master/data_structures/hashing/hash_table_with_linked_list.py) - * Number Theory - * [Prime Numbers](https://github.com/TheAlgorithms/Python/blob/master/data_structures/hashing/number_theory/prime_numbers.py) - * [Quadratic Probing](https://github.com/TheAlgorithms/Python/blob/master/data_structures/hashing/quadratic_probing.py) - * Heap - * [Binomial Heap](https://github.com/TheAlgorithms/Python/blob/master/data_structures/heap/binomial_heap.py) - * [Heap](https://github.com/TheAlgorithms/Python/blob/master/data_structures/heap/heap.py) - * [Min Heap](https://github.com/TheAlgorithms/Python/blob/master/data_structures/heap/min_heap.py) - * Linked List - * [Circular Linked List](https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/circular_linked_list.py) - * [Doubly Linked List](https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/doubly_linked_list.py) - * [From Sequence](https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/from_sequence.py) - * [Is Palindrome](https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/is_palindrome.py) - * [Print Reverse](https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/print_reverse.py) - * [Singly Linked List](https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/singly_linked_list.py) - * [Swap Nodes](https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/swap_nodes.py) - * Queue - * [Circular Queue](https://github.com/TheAlgorithms/Python/blob/master/data_structures/queue/circular_queue.py) - * [Double Ended Queue](https://github.com/TheAlgorithms/Python/blob/master/data_structures/queue/double_ended_queue.py) - * [Linked Queue](https://github.com/TheAlgorithms/Python/blob/master/data_structures/queue/linked_queue.py) - * [Queue On List](https://github.com/TheAlgorithms/Python/blob/master/data_structures/queue/queue_on_list.py) - * [Queue On Pseudo Stack](https://github.com/TheAlgorithms/Python/blob/master/data_structures/queue/queue_on_pseudo_stack.py) - * Stacks - * [Balanced Parentheses](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/balanced_parentheses.py) - * [Infix To Postfix Conversion](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/infix_to_postfix_conversion.py) - * [Infix To Prefix Conversion](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/infix_to_prefix_conversion.py) - * [Linked Stack](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/linked_stack.py) - * [Next Greater Element](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/next_greater_element.py) - * [Postfix Evaluation](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/postfix_evaluation.py) - * [Stack](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/stack.py) - * [Stock Span Problem](https://github.com/TheAlgorithms/Python/blob/master/data_structures/stacks/stock_span_problem.py) - * Trie - * [Trie](https://github.com/TheAlgorithms/Python/blob/master/data_structures/trie/trie.py) - -## Digital Image Processing - * [Change Contrast](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/change_contrast.py) - * Edge Detection - * [Canny](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/edge_detection/canny.py) - * Filters - * [Convolve](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/convolve.py) - * [Gaussian Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/gaussian_filter.py) - * [Median Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/median_filter.py) - * [Sobel Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/sobel_filter.py) - * [Index Calculation](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/index_calculation.py) - * Rotation - * [Rotation](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/rotation/rotation.py) - * [Test Digital Image Processing](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/test_digital_image_processing.py) - -## Divide And Conquer - * [Closest Pair Of Points](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/closest_pair_of_points.py) - * [Convex Hull](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/convex_hull.py) - * [Inversions](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/inversions.py) - * [Max Subarray Sum](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/max_subarray_sum.py) - * [Mergesort](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/mergesort.py) - -## Dynamic Programming - * [Abbreviation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/abbreviation.py) - * [All Submasks of Mask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/iterating_through_submasks.py) - * [Bitmask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/bitmask.py) - * [Climbing Stairs](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/climbing_stairs.py) - * [Coin Change](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/coin_change.py) - * [Edit Distance](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/edit_distance.py) - * [Factorial](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/factorial.py) - * [Fast Fibonacci](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/fast_fibonacci.py) - * [Fibonacci](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/fibonacci.py) - * [Floyd Warshall](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/floyd_warshall.py) - * [Fractional Knapsack](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/fractional_knapsack.py) - * [Fractional Knapsack 2](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/fractional_knapsack_2.py) - * [Integer Partition](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/integer_partition.py) - * [K Means Clustering Tensorflow](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/k_means_clustering_tensorflow.py) - * [Knapsack](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/knapsack.py) - * [Longest Common Subsequence](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/longest_common_subsequence.py) - * [Longest Increasing Subsequence](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/longest_increasing_subsequence.py) - * [Longest Increasing Subsequence O(Nlogn)](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/longest_increasing_subsequence_o(nlogn).py) - * [Longest Sub Array](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/longest_sub_array.py) - * [Matrix Chain Order](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/matrix_chain_order.py) - * [Max Sub Array](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/max_sub_array.py) - * [Max Sum Contigous Subsequence](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/max_sum_contigous_subsequence.py) - * [Minimum Partition](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/minimum_partition.py) - * [Rod Cutting](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/rod_cutting.py) - * [Subset Generation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/subset_generation.py) - * [Sum Of Subset](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/sum_of_subset.py) - -## File Transfer - * [Recieve File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/recieve_file.py) - * [Send File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/send_file.py) - -## Fuzzy Logic - * [Fuzzy Operations](https://github.com/TheAlgorithms/Python/blob/master/fuzzy_logic/fuzzy_operations.py) - -## Graphs - * [A Star](https://github.com/TheAlgorithms/Python/blob/master/graphs/a_star.py) - * [Articulation Points](https://github.com/TheAlgorithms/Python/blob/master/graphs/articulation_points.py) - * [Basic Graphs](https://github.com/TheAlgorithms/Python/blob/master/graphs/basic_graphs.py) - * [Bellman Ford](https://github.com/TheAlgorithms/Python/blob/master/graphs/bellman_ford.py) - * [Bfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/bfs.py) - * [Bfs Shortest Path](https://github.com/TheAlgorithms/Python/blob/master/graphs/bfs_shortest_path.py) - * [Breadth First Search](https://github.com/TheAlgorithms/Python/blob/master/graphs/breadth_first_search.py) - * [Check Bipartite Graph Bfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_bipartite_graph_bfs.py) - * [Check Bipartite Graph Dfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_bipartite_graph_dfs.py) - * [Depth First Search](https://github.com/TheAlgorithms/Python/blob/master/graphs/depth_first_search.py) - * [Dfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/dfs.py) - * [Dijkstra](https://github.com/TheAlgorithms/Python/blob/master/graphs/dijkstra.py) - * [Dijkstra 2](https://github.com/TheAlgorithms/Python/blob/master/graphs/dijkstra_2.py) - * [Dijkstra Algorithm](https://github.com/TheAlgorithms/Python/blob/master/graphs/dijkstra_algorithm.py) - * [Dinic](https://github.com/TheAlgorithms/Python/blob/master/graphs/dinic.py) - * [Directed And Undirected (Weighted) Graph](https://github.com/TheAlgorithms/Python/blob/master/graphs/directed_and_undirected_(weighted)_graph.py) - * [Edmonds Karp Multiple Source And Sink](https://github.com/TheAlgorithms/Python/blob/master/graphs/edmonds_karp_multiple_source_and_sink.py) - * [Eulerian Path And Circuit For Undirected Graph](https://github.com/TheAlgorithms/Python/blob/master/graphs/eulerian_path_and_circuit_for_undirected_graph.py) - * [Even Tree](https://github.com/TheAlgorithms/Python/blob/master/graphs/even_tree.py) - * [Finding Bridges](https://github.com/TheAlgorithms/Python/blob/master/graphs/finding_bridges.py) - * [G Topological Sort](https://github.com/TheAlgorithms/Python/blob/master/graphs/g_topological_sort.py) - * [Graph List](https://github.com/TheAlgorithms/Python/blob/master/graphs/graph_list.py) - * [Graph Matrix](https://github.com/TheAlgorithms/Python/blob/master/graphs/graph_matrix.py) - * [Graphs Floyd Warshall](https://github.com/TheAlgorithms/Python/blob/master/graphs/graphs_floyd_warshall.py) - * [Kahns Algorithm Long](https://github.com/TheAlgorithms/Python/blob/master/graphs/kahns_algorithm_long.py) - * [Kahns Algorithm Topo](https://github.com/TheAlgorithms/Python/blob/master/graphs/kahns_algorithm_topo.py) - * [Minimum Spanning Tree Kruskal](https://github.com/TheAlgorithms/Python/blob/master/graphs/minimum_spanning_tree_kruskal.py) - * [Minimum Spanning Tree Prims](https://github.com/TheAlgorithms/Python/blob/master/graphs/minimum_spanning_tree_prims.py) - * [Multi Hueristic Astar](https://github.com/TheAlgorithms/Python/blob/master/graphs/multi_hueristic_astar.py) - * [Page Rank](https://github.com/TheAlgorithms/Python/blob/master/graphs/page_rank.py) - * [Prim](https://github.com/TheAlgorithms/Python/blob/master/graphs/prim.py) - * [Scc Kosaraju](https://github.com/TheAlgorithms/Python/blob/master/graphs/scc_kosaraju.py) - * [Tarjans Scc](https://github.com/TheAlgorithms/Python/blob/master/graphs/tarjans_scc.py) - -## Hashes - * [Chaos Machine](https://github.com/TheAlgorithms/Python/blob/master/hashes/chaos_machine.py) - * [Enigma Machine](https://github.com/TheAlgorithms/Python/blob/master/hashes/enigma_machine.py) - * [Hamming Code](https://github.com/TheAlgorithms/Python/blob/master/hashes/hamming_code.py) - * [Md5](https://github.com/TheAlgorithms/Python/blob/master/hashes/md5.py) - * [Sha1](https://github.com/TheAlgorithms/Python/blob/master/hashes/sha1.py) - -## Linear Algebra - * Src - * [Lib](https://github.com/TheAlgorithms/Python/blob/master/linear_algebra/src/lib.py) - * [Polynom-For-Points](https://github.com/TheAlgorithms/Python/blob/master/linear_algebra/src/polynom-for-points.py) - * [Test Linear Algebra](https://github.com/TheAlgorithms/Python/blob/master/linear_algebra/src/test_linear_algebra.py) - -## Machine Learning - * [Decision Tree](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/decision_tree.py) - * [Gradient Descent](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/gradient_descent.py) - * [K Means Clust](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/k_means_clust.py) - * [K Nearest Neighbours](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/k_nearest_neighbours.py) - * [Knn Sklearn](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/knn_sklearn.py) - * [Linear Discriminant Analysis](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/linear_discriminant_analysis.py) - * [Linear Regression](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/linear_regression.py) - * [Logistic Regression](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/logistic_regression.py) - * [Multilayer Perceptron Classifier](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/multilayer_perceptron_classifier.py) - * [Polymonial Regression](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/polymonial_regression.py) - * [Scoring Functions](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/scoring_functions.py) - * [Sequential Minimum Optimization](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/sequential_minimum_optimization.py) - * [Support Vector Machines](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/support_vector_machines.py) - -## Maths - * [3N+1](https://github.com/TheAlgorithms/Python/blob/master/maths/3n+1.py) - * [Abs](https://github.com/TheAlgorithms/Python/blob/master/maths/abs.py) - * [Abs Max](https://github.com/TheAlgorithms/Python/blob/master/maths/abs_max.py) - * [Abs Min](https://github.com/TheAlgorithms/Python/blob/master/maths/abs_min.py) - * [Average Mean](https://github.com/TheAlgorithms/Python/blob/master/maths/average_mean.py) - * [Average Median](https://github.com/TheAlgorithms/Python/blob/master/maths/average_median.py) - * [Average Mode](https://github.com/TheAlgorithms/Python/blob/master/maths/average_mode.py) - * [Basic Maths](https://github.com/TheAlgorithms/Python/blob/master/maths/basic_maths.py) - * [Binary Exponentiation](https://github.com/TheAlgorithms/Python/blob/master/maths/binary_exponentiation.py) - * [Binomial Coefficient](https://github.com/TheAlgorithms/Python/blob/master/maths/binomial_coefficient.py) - * [Ceil](https://github.com/TheAlgorithms/Python/blob/master/maths/ceil.py) - * [Collatz Sequence](https://github.com/TheAlgorithms/Python/blob/master/maths/collatz_sequence.py) - * [Eulers Totient](https://github.com/TheAlgorithms/Python/blob/master/maths/eulers_totient.py) - * [Explicit Euler](https://github.com/TheAlgorithms/Python/blob/master/maths/explicit_euler.py) - * [Extended Euclidean Algorithm](https://github.com/TheAlgorithms/Python/blob/master/maths/extended_euclidean_algorithm.py) - * [Factorial Python](https://github.com/TheAlgorithms/Python/blob/master/maths/factorial_python.py) - * [Factorial Recursive](https://github.com/TheAlgorithms/Python/blob/master/maths/factorial_recursive.py) - * [Factors](https://github.com/TheAlgorithms/Python/blob/master/maths/factors.py) - * [Fermat Little Theorem](https://github.com/TheAlgorithms/Python/blob/master/maths/fermat_little_theorem.py) - * [Fibonacci](https://github.com/TheAlgorithms/Python/blob/master/maths/fibonacci.py) - * [Fibonacci Sequence Recursion](https://github.com/TheAlgorithms/Python/blob/master/maths/fibonacci_sequence_recursion.py) - * [Find Max](https://github.com/TheAlgorithms/Python/blob/master/maths/find_max.py) - * [Find Max Recursion](https://github.com/TheAlgorithms/Python/blob/master/maths/find_max_recursion.py) - * [Find Min](https://github.com/TheAlgorithms/Python/blob/master/maths/find_min.py) - * [Find Min Recursion](https://github.com/TheAlgorithms/Python/blob/master/maths/find_min_recursion.py) - * [Floor](https://github.com/TheAlgorithms/Python/blob/master/maths/floor.py) - * [Gaussian](https://github.com/TheAlgorithms/Python/blob/master/maths/gaussian.py) - * [Greatest Common Divisor](https://github.com/TheAlgorithms/Python/blob/master/maths/greatest_common_divisor.py) - * [Hardy Ramanujanalgo](https://github.com/TheAlgorithms/Python/blob/master/maths/hardy_ramanujanalgo.py) - * [Is Square Free](https://github.com/TheAlgorithms/Python/blob/master/maths/is_square_free.py) - * [Jaccard Similarity](https://github.com/TheAlgorithms/Python/blob/master/maths/jaccard_similarity.py) - * [Karatsuba](https://github.com/TheAlgorithms/Python/blob/master/maths/karatsuba.py) - * [Kth Lexicographic Permutation](https://github.com/TheAlgorithms/Python/blob/master/maths/kth_lexicographic_permutation.py) - * [Largest Of Very Large Numbers](https://github.com/TheAlgorithms/Python/blob/master/maths/largest_of_very_large_numbers.py) - * [Least Common Multiple](https://github.com/TheAlgorithms/Python/blob/master/maths/least_common_multiple.py) - * [Lucas Lehmer Primality Test](https://github.com/TheAlgorithms/Python/blob/master/maths/lucas_lehmer_primality_test.py) - * [Lucas Series](https://github.com/TheAlgorithms/Python/blob/master/maths/lucas_series.py) - * [Matrix Exponentiation](https://github.com/TheAlgorithms/Python/blob/master/maths/matrix_exponentiation.py) - * [Mobius Function](https://github.com/TheAlgorithms/Python/blob/master/maths/mobius_function.py) - * [Modular Exponential](https://github.com/TheAlgorithms/Python/blob/master/maths/modular_exponential.py) - * [Newton Raphson](https://github.com/TheAlgorithms/Python/blob/master/maths/newton_raphson.py) - * [Perfect Square](https://github.com/TheAlgorithms/Python/blob/master/maths/perfect_square.py) - * [Polynomial Evaluation](https://github.com/TheAlgorithms/Python/blob/master/maths/polynomial_evaluation.py) - * [Prime Check](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_check.py) - * [Prime Factors](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_factors.py) - * [Prime Numbers](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_numbers.py) - * [Prime Sieve Eratosthenes](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_sieve_eratosthenes.py) - * [Pythagoras](https://github.com/TheAlgorithms/Python/blob/master/maths/pythagoras.py) - * [Qr Decomposition](https://github.com/TheAlgorithms/Python/blob/master/maths/qr_decomposition.py) - * [Quadratic Equations Complex Numbers](https://github.com/TheAlgorithms/Python/blob/master/maths/quadratic_equations_complex_numbers.py) - * [Radix2 Fft](https://github.com/TheAlgorithms/Python/blob/master/maths/radix2_fft.py) - * [Runge Kutta](https://github.com/TheAlgorithms/Python/blob/master/maths/runge_kutta.py) - * [Segmented Sieve](https://github.com/TheAlgorithms/Python/blob/master/maths/segmented_sieve.py) - * [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Python/blob/master/maths/sieve_of_eratosthenes.py) - * [Simpson Rule](https://github.com/TheAlgorithms/Python/blob/master/maths/simpson_rule.py) - * [Softmax](https://github.com/TheAlgorithms/Python/blob/master/maths/softmax.py) - * [Sum Of Arithmetic Series](https://github.com/TheAlgorithms/Python/blob/master/maths/sum_of_arithmetic_series.py) - * [Test Prime Check](https://github.com/TheAlgorithms/Python/blob/master/maths/test_prime_check.py) - * [Trapezoidal Rule](https://github.com/TheAlgorithms/Python/blob/master/maths/trapezoidal_rule.py) - * [Volume](https://github.com/TheAlgorithms/Python/blob/master/maths/volume.py) - * [Zellers Congruence](https://github.com/TheAlgorithms/Python/blob/master/maths/zellers_congruence.py) - -## Matrix - * [Matrix Class](https://github.com/TheAlgorithms/Python/blob/master/matrix/matrix_class.py) - * [Matrix Operation](https://github.com/TheAlgorithms/Python/blob/master/matrix/matrix_operation.py) - * [Nth Fibonacci Using Matrix Exponentiation](https://github.com/TheAlgorithms/Python/blob/master/matrix/nth_fibonacci_using_matrix_exponentiation.py) - * [Rotate Matrix](https://github.com/TheAlgorithms/Python/blob/master/matrix/rotate_matrix.py) - * [Searching In Sorted Matrix](https://github.com/TheAlgorithms/Python/blob/master/matrix/searching_in_sorted_matrix.py) - * [Sherman Morrison](https://github.com/TheAlgorithms/Python/blob/master/matrix/sherman_morrison.py) - * [Spiral Print](https://github.com/TheAlgorithms/Python/blob/master/matrix/spiral_print.py) - * Tests - * [Test Matrix Operation](https://github.com/TheAlgorithms/Python/blob/master/matrix/tests/test_matrix_operation.py) - -## Networking Flow - * [Ford Fulkerson](https://github.com/TheAlgorithms/Python/blob/master/networking_flow/ford_fulkerson.py) - * [Minimum Cut](https://github.com/TheAlgorithms/Python/blob/master/networking_flow/minimum_cut.py) - -## Neural Network - * [Back Propagation Neural Network](https://github.com/TheAlgorithms/Python/blob/master/neural_network/back_propagation_neural_network.py) - * [Convolution Neural Network](https://github.com/TheAlgorithms/Python/blob/master/neural_network/convolution_neural_network.py) - * [Gan](https://github.com/TheAlgorithms/Python/blob/master/neural_network/gan.py) - * [Input Data](https://github.com/TheAlgorithms/Python/blob/master/neural_network/input_data.py) - * [Perceptron](https://github.com/TheAlgorithms/Python/blob/master/neural_network/perceptron.py) - -## Other - * [Activity Selection](https://github.com/TheAlgorithms/Python/blob/master/other/activity_selection.py) - * [Anagrams](https://github.com/TheAlgorithms/Python/blob/master/other/anagrams.py) - * [Autocomplete Using Trie](https://github.com/TheAlgorithms/Python/blob/master/other/autocomplete_using_trie.py) - * [Binary Exponentiation](https://github.com/TheAlgorithms/Python/blob/master/other/binary_exponentiation.py) - * [Binary Exponentiation 2](https://github.com/TheAlgorithms/Python/blob/master/other/binary_exponentiation_2.py) - * [Detecting English Programmatically](https://github.com/TheAlgorithms/Python/blob/master/other/detecting_english_programmatically.py) - * [Euclidean Gcd](https://github.com/TheAlgorithms/Python/blob/master/other/euclidean_gcd.py) - * [Fischer Yates Shuffle](https://github.com/TheAlgorithms/Python/blob/master/other/fischer_yates_shuffle.py) - * [Frequency Finder](https://github.com/TheAlgorithms/Python/blob/master/other/frequency_finder.py) - * [Game Of Life](https://github.com/TheAlgorithms/Python/blob/master/other/game_of_life.py) - * [Greedy](https://github.com/TheAlgorithms/Python/blob/master/other/greedy.py) - * [Integeration](https://github.com/TheAlgorithms/Python/blob/master/other/integeration_by_simpson_approx.py) - * [Largest Subarray Sum](https://github.com/TheAlgorithms/Python/blob/master/other/largest_subarray_sum.py) - * [Least Recently Used](https://github.com/TheAlgorithms/Python/blob/master/other/least_recently_used.py) - * [Linear Congruential Generator](https://github.com/TheAlgorithms/Python/blob/master/other/linear_congruential_generator.py) - * [Magicdiamondpattern](https://github.com/TheAlgorithms/Python/blob/master/other/magicdiamondpattern.py) - * [Nested Brackets](https://github.com/TheAlgorithms/Python/blob/master/other/nested_brackets.py) - * [Palindrome](https://github.com/TheAlgorithms/Python/blob/master/other/palindrome.py) - * [Password Generator](https://github.com/TheAlgorithms/Python/blob/master/other/password_generator.py) - * [Primelib](https://github.com/TheAlgorithms/Python/blob/master/other/primelib.py) - * [Sdes](https://github.com/TheAlgorithms/Python/blob/master/other/sdes.py) - * [Sierpinski Triangle](https://github.com/TheAlgorithms/Python/blob/master/other/sierpinski_triangle.py) - * [Tower Of Hanoi](https://github.com/TheAlgorithms/Python/blob/master/other/tower_of_hanoi.py) - * [Two Sum](https://github.com/TheAlgorithms/Python/blob/master/other/two_sum.py) - * [Word Patterns](https://github.com/TheAlgorithms/Python/blob/master/other/word_patterns.py) - -## Project Euler - * Problem 01 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_01/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_01/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_01/sol3.py) - * [Sol4](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_01/sol4.py) - * [Sol5](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_01/sol5.py) - * [Sol6](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_01/sol6.py) - * [Sol7](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_01/sol7.py) - * Problem 02 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_02/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_02/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_02/sol3.py) - * [Sol4](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_02/sol4.py) - * [Sol5](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_02/sol5.py) - * Problem 03 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_03/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_03/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_03/sol3.py) - * Problem 04 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_04/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_04/sol2.py) - * Problem 05 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_05/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_05/sol2.py) - * Problem 06 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_06/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_06/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_06/sol3.py) - * [Sol4](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_06/sol4.py) - * Problem 07 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_07/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_07/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_07/sol3.py) - * Problem 08 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_08/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_08/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_08/sol3.py) - * Problem 09 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_09/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_09/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_09/sol3.py) - * Problem 10 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_10/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_10/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_10/sol3.py) - * Problem 11 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_11/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_11/sol2.py) - * Problem 12 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_12/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_12/sol2.py) - * Problem 13 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_13/sol1.py) - * Problem 14 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_14/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_14/sol2.py) - * Problem 15 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_15/sol1.py) - * Problem 16 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_16/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_16/sol2.py) - * Problem 17 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_17/sol1.py) - * Problem 18 - * [Solution](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_18/solution.py) - * Problem 19 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_19/sol1.py) - * Problem 20 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol3.py) - * [Sol4](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol4.py) - * Problem 21 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_21/sol1.py) - * Problem 22 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_22/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_22/sol2.py) - * Problem 23 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_23/sol1.py) - * Problem 234 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_234/sol1.py) - * Problem 24 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_24/sol1.py) - * Problem 25 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol1.py) - * [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol2.py) - * [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol3.py) - * Problem 27 - * [Problem 27 Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_27/problem_27_sol1.py) - * Problem 28 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_28/sol1.py) - * Problem 29 - * [Solution](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_29/solution.py) - * Problem 31 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_31/sol1.py) - * Problem 32 - * [Sol32](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_32/sol32.py) - * Problem 33 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_33/sol1.py) - * Problem 36 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_36/sol1.py) - * Problem 40 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_40/sol1.py) - * Problem 42 - * [Solution42](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_42/solution42.py) - * Problem 48 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_48/sol1.py) - * Problem 52 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_52/sol1.py) - * Problem 53 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_53/sol1.py) - * Problem 551 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_551/sol1.py) - * Problem 56 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_56/sol1.py) - * Problem 67 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_67/sol1.py) - * Problem 76 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_76/sol1.py) - * Problem 99 - * [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_99/sol1.py) - -## Searches - * [Binary Search](https://github.com/TheAlgorithms/Python/blob/master/searches/binary_search.py) - * [Fibonacci Search](https://github.com/TheAlgorithms/Python/blob/master/searches/fibonacci_search.py) - * [Interpolation Search](https://github.com/TheAlgorithms/Python/blob/master/searches/interpolation_search.py) - * [Jump Search](https://github.com/TheAlgorithms/Python/blob/master/searches/jump_search.py) - * [Linear Search](https://github.com/TheAlgorithms/Python/blob/master/searches/linear_search.py) - * [Quick Select](https://github.com/TheAlgorithms/Python/blob/master/searches/quick_select.py) - * [Sentinel Linear Search](https://github.com/TheAlgorithms/Python/blob/master/searches/sentinel_linear_search.py) - * [Simple-Binary-Search](https://github.com/TheAlgorithms/Python/blob/master/searches/simple-binary-search.py) - * [Tabu Search](https://github.com/TheAlgorithms/Python/blob/master/searches/tabu_search.py) - * [Ternary Search](https://github.com/TheAlgorithms/Python/blob/master/searches/ternary_search.py) - -## Sorts - * [Bitonic Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/bitonic_sort.py) - * [Bogo Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/bogo_sort.py) - * [Bubble Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/bubble_sort.py) - * [Bucket Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/bucket_sort.py) - * [Cocktail Shaker Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/cocktail_shaker_sort.py) - * [Comb Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/comb_sort.py) - * [Counting Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/counting_sort.py) - * [Cycle Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/cycle_sort.py) - * [Double Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/double_sort.py) - * [External Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/external_sort.py) - * [Gnome Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/gnome_sort.py) - * [Heap Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/heap_sort.py) - * [I Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/i_sort.py) - * [Insertion Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/insertion_sort.py) - * [Merge Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/merge_sort.py) - * [Odd Even Transposition Parallel](https://github.com/TheAlgorithms/Python/blob/master/sorts/odd_even_transposition_parallel.py) - * [Odd Even Transposition Single Threaded](https://github.com/TheAlgorithms/Python/blob/master/sorts/odd_even_transposition_single_threaded.py) - * [Pancake Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/pancake_sort.py) - * [Pigeon Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/pigeon_sort.py) - * [Pigeonhole Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/pigeonhole_sort.py) - * [Quick Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/quick_sort.py) - * [Quick Sort 3 Partition](https://github.com/TheAlgorithms/Python/blob/master/sorts/quick_sort_3_partition.py) - * [Radix Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/radix_sort.py) - * [Random Normal Distribution Quicksort](https://github.com/TheAlgorithms/Python/blob/master/sorts/random_normal_distribution_quicksort.py) - * [Random Pivot Quick Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/random_pivot_quick_sort.py) - * [Recursive-Quick-Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/recursive-quick-sort.py) - * [Selection Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/selection_sort.py) - * [Shell Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/shell_sort.py) - * [Stooge Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/stooge_sort.py) - * [Tim Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/tim_sort.py) - * [Topological Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/topological_sort.py) - * [Tree Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/tree_sort.py) - * [Unknown Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/unknown_sort.py) - * [Wiggle Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/wiggle_sort.py) - -## Strings - * [Aho-Corasick](https://github.com/TheAlgorithms/Python/blob/master/strings/aho-corasick.py) - * [Boyer Moore Search](https://github.com/TheAlgorithms/Python/blob/master/strings/boyer_moore_search.py) - * [Check Panagram](https://github.com/TheAlgorithms/Python/blob/master/strings/check_panagram.py) - * [Knuth Morris Pratt](https://github.com/TheAlgorithms/Python/blob/master/strings/knuth_morris_pratt.py) - * [Levenshtein Distance](https://github.com/TheAlgorithms/Python/blob/master/strings/levenshtein_distance.py) - * [Manacher](https://github.com/TheAlgorithms/Python/blob/master/strings/manacher.py) - * [Min Cost String Conversion](https://github.com/TheAlgorithms/Python/blob/master/strings/min_cost_string_conversion.py) - * [Naive String Search](https://github.com/TheAlgorithms/Python/blob/master/strings/naive_string_search.py) - * [Rabin Karp](https://github.com/TheAlgorithms/Python/blob/master/strings/rabin_karp.py) - * [Remove Duplicate](https://github.com/TheAlgorithms/Python/blob/master/strings/remove_duplicate.py) - * [Reverse Words](https://github.com/TheAlgorithms/Python/blob/master/strings/reverse_words.py) - * [Word Occurence](https://github.com/TheAlgorithms/Python/blob/master/strings/word_occurence.py) - -## Traversals - * [Binary Tree Traversals](https://github.com/TheAlgorithms/Python/blob/master/traversals/binary_tree_traversals.py) - -## Web Programming - * [Crawl Google Results](https://github.com/TheAlgorithms/Python/blob/master/web_programming/crawl_google_results.py) - * [Current Stock Price](https://github.com/TheAlgorithms/Python/blob/master/web_programming/current_stock_price.py) - * [Fetch Bbc News](https://github.com/TheAlgorithms/Python/blob/master/web_programming/fetch_bbc_news.py) - * [Fetch Github Info](https://github.com/TheAlgorithms/Python/blob/master/web_programming/fetch_github_info.py) - * [Get Imdbtop](https://github.com/TheAlgorithms/Python/blob/master/web_programming/get_imdbtop.py) - * [Slack Message](https://github.com/TheAlgorithms/Python/blob/master/web_programming/slack_message.py) From f951bbfe61a67fa3e4c925096cc6bb45ba93cad8 Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Fri, 20 Dec 2019 19:42:51 +0530 Subject: [PATCH 13/15] Revert "updated" This reverts commit 73456f85de03782b7d3c794eca8390a4fe87037c. --- diff | 578 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 578 insertions(+) create mode 100644 diff diff --git a/diff b/diff new file mode 100644 index 000000000000..49ce64441717 --- /dev/null +++ b/diff @@ -0,0 +1,578 @@ +commit b3946094a78e1ccbcddf80130082ef76a0e000d0 (HEAD -> master, origin/master, origin/HEAD) +Author: faizan2700 +Date: Wed Dec 18 10:38:21 2019 +0530 + + iterating_through_submasks.py is added in dynamic_programming + +commit 00351ca8992cc9b8a959274861a25d19123e81ba +Author: faizan2700 +Date: Wed Dec 18 10:27:19 2019 +0530 + + iterating_through_submasks is added with doctests + +commit 6e484d8e7ca1cd13af0c6e901d8a23d34acf2ae5 +Author: faizan2700 +Date: Tue Dec 17 22:56:06 2019 +0530 + + *iterating_through_submasks.py is added in dynamic_programming + +commit ac5b41ca40b4713619b836b513c0116ddcc33848 +Author: faizan2700 +Date: Tue Dec 17 22:48:50 2019 +0530 + + no changes + +commit 01121afa65ed6a175a3e976515ed604e90a1623f +Author: faizan2700 +Date: Tue Dec 17 22:44:44 2019 +0530 + + new file *iterating_through_submasks* is added in dynamic_programming section + +commit f4779bc04ae706b0c548e2fe6d7a59efe8b85524 +Author: Rohit Joshi <34398948+rohitjoshi21@users.noreply.github.com> +Date: Sun Dec 15 13:12:07 2019 +0545 + + Bug Fixed in newton_raphson_method.py (#1634) + + * Bug Fixed + + * Fixed newton_raphson_method.py + + * Fixed newton_raphson_method.py 2 + + * Fixed newton_raphson_method.py 3 + + * Fixed newton_raphson_method.py 4 + + * Fixed newton_raphson_method.py 5 + + * Fixed newton_raphson_method.py 6 + + * Update newton_raphson_method.py + + * Update newton_raphson_method.py + + * # noqa: F401, F403 + + * newton_raphson + + * newton_raphson + + * precision: int=10 ** -10 + + * return float(x) + + * 3.1415926536808043 + + * Update newton_raphson_method.py + + * 2.23606797749979 + + * Update newton_raphson_method.py + + * Rename newton_raphson_method.py to newton_raphson.py + +commit bc5b92f7f9de09bbaba96cd7fc8b2853dc0c080c +Author: Muhammad Ibtihaj Naeem +Date: Sat Dec 14 10:46:02 2019 +0500 + + Harmonic Geometric and P-Series Added (#1633) + + * Harmonic Geometric and P-Series Added + + * Editing comments + + * Update and rename series/Geometric_Series.py to maths/series/geometric_series.py + + * Update and rename series/Harmonic_Series.py to maths/series/harmonic_series.py + + * Update and rename series/P_Series.py to maths/series/p_series.py + +commit d385472c6fe5abda18759f89e81efe1f0bf6da0f +Author: heartsmoking <327899144@qq.com> +Date: Wed Dec 11 14:57:08 2019 +0800 + + Update find_min.py (#1627) + + Line 5: :return: max number in list + "max" must be "min" + +commit b9bff8f3a72427b5d2ae3f2f174dc5db11df0d50 +Author: Christian Clauss +Date: Tue Dec 10 15:53:50 2019 +0100 + + Remove \r from strings (#1622) + + * Remove \r from strings + + * Satisfy tensorflow with numpy>=1.17.4 + +commit 1cbeaa252ad5822c9197b385a99e550f7aa2f897 +Author: Binish Manandhar <37204996+binish784@users.noreply.github.com> +Date: Tue Dec 10 12:37:40 2019 +0545 + + Image processing algorithms added (#616) + + * Image processing algorithms added + + * Example images included + + * Issues resolved + + * class added + + * Naming issues fixes + + * Create file_path + +commit 9316618611967c26b98ce275fab238f735f2864e +Author: Shoaib Asgar +Date: Mon Dec 9 07:59:01 2019 +0530 + + digital_image_processing/convert_to_negative (#1216) + + * digital_image_processing/convert_to_negative + + * added doc + + * added test code + + * Update convert_to_negative.py + +commit 02b717e364cd6623e303d4cc2378d1448779dc2b +Author: Samarth Sehgal +Date: Mon Dec 9 09:43:56 2019 +1100 + + Update odd_even_transposition_parallel.py (#1458) + + * Update odd_even_transposition_parallel.py + + * arr = OddEvenTransposition(arr) + +commit 74d96ab3558120b6810aa3f613e091774aefeca3 +Author: Jawpral <34590600+Jawpral@users.noreply.github.com> +Date: Mon Dec 9 03:57:42 2019 +0530 + + Fixed issue #1368 (#1482) + + * Changed as suggested + + Now return in same format as oct() returns + + * Slight change + + * Fixed issue #1368, return values for large number now is fixed and does not return in scientific notation + + * Update decimal_to_octal.py + +commit 43905efe298172e9e9280661d80af8f7e2105517 +Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> +Date: Mon Dec 9 01:45:17 2019 +0330 + + Adding doctests into LDA algorithm (#1621) + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * Adding doctests into function + + * fixup! Format Python code with psf/black push + + * Update convex_hull.py + + * Update convex_hull.py + +commit 26b0803319b6cf14f623769356c79343e3d43d14 +Author: Christian Clauss +Date: Sun Dec 8 22:42:17 2019 +0100 + + 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 + +commit 9eb50cc223f7a8da8d7299bf4db8e4d3313b8bff +Author: GeorgeChambi +Date: Sat Dec 7 05:39:59 2019 +0000 + + Improved readability (#1615) + + * improved readability + + * further readability improvements + + * removed csv file and added f + +commit 938dd0bbb5145aa7c60127745ae0571cb20a2387 +Author: Níkolas Vargas +Date: Sat Dec 7 02:39:08 2019 -0300 + + improved prime numbers implementation (#1606) + + * improved prime numbers implementation + + * fixup! Format Python code with psf/black push + + * fix type hint + + * fixup! Format Python code with psf/black push + + * fix doctests + + * updating DIRECTORY.md + + * added prime tests with negative numbers + + * using for instead filter + + * updating DIRECTORY.md + + * Remove unused typing.List + + * Remove tab indentation + + * print("Sorted order is:", " ".join(a)) + +commit ccc1ff2ce89af2a569f1fbfa16ff70ad22ed9e89 +Author: SHAKTI SINGH +Date: Fri Dec 6 12:04:21 2019 +0530 + + pigeonhole sorting in python (#364) + + * pigeonhole sorting in python + + * variable name update in pigeonhole_sort.py + + * Add doctest + +commit 3cfca42f17e4e5f3d31da30eb80f7c0baa66eb4b +Author: João Gustavo A. Amorim +Date: Fri Dec 6 03:13:10 2019 -0300 + + add the index calculation class at digital_image_processing and the hamming code algorithm at hashes (#1152) + + * add the index calculation at difital_image_processing file + + * make changes at index_calculation + + * update the variables to self variables at functions + + * update the word wrap in comments at index_calculation + + * add the hamming code algorithm + + * Wrap long lines + +commit 494fb4fb490c49d46c693933c5583ac2fb4f665b +Author: Bardia Alavi +Date: Wed Dec 4 23:06:41 2019 -0500 + + address merge_soft duplicate files (#1612) + + Here the old file merge_sort_fastest is renamed to unknown_sort. Because it is not merge sort algorithm. + + Comments are updated accordingly. + +commit caad74466aaa6a98465e10bd7adf828482d2de63 +Author: QuantumNovice <43876848+QuantumNovice@users.noreply.github.com> +Date: Tue Dec 3 16:17:42 2019 +0500 + + Added Multilayer Perceptron (sklearn) (#1609) + + * Added Multilayer Perceptron ( sklearn) + + * Rename MLPClassifier.py to multilayer_preceptron_classifier.py + + * Rename multilayer_preceptron_classifier.py to multilayer_perceptron_classifier.py + + * Update multilayer_perceptron_classifier.py + +commit 8ffc4f8706dc5ecb7cd015839f1cb92997217c63 +Author: GeorgeChambi +Date: Tue Dec 3 11:14:30 2019 +0000 + + fixed bug (#1610) + + Removed comma from print statement causing and error. + +commit 74aeaa333f81912b696e0cf069e4993bc94113cc +Author: Abhijit Patil +Date: Sun Dec 1 11:28:25 2019 +0530 + + Code for Eulers Totient function (#1229) + + * Create eulersTotient.py + + * Rename eulersTotient.py to eulers_totient.py + + * Update eulers_totient.py + +commit 4dca9571dba5b6d0ce31fe49e8928451573a34af +Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> +Date: Sun Dec 1 02:29:23 2019 -0300 + + Pythagoras (#1243) + + * add pythagoras.py + + * function distance + + * run as script + + * Update pythagoras.py + +commit 415c9f5e6547457eb3546b467283cbd9e82e4eec +Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> +Date: Sun Dec 1 02:13:28 2019 -0300 + + Improve prim.py (#1226) + + * suiting PEP8 + + * create auxiliary function + + * running example + + * updating DIRECTORY.md + +commit 5d20dbfb98a19634db0961318f5378f50e94c428 +Author: Saurabh Goyal +Date: Sat Nov 30 10:47:13 2019 +0530 + + add a generic heap (#906) + + * add a generic heap + + * Delete __init__.py + + * Rename data_structures/Heap/heap_generic.py to data_structures/heap/heap_generic.py + + * Add doctests + + * Fix doctests + + * Fix doctests again + +commit 2fb6f786ceff9fef94494d73d541a4e7e5feafed +Author: Christian Clauss +Date: Thu Nov 28 19:53:37 2019 +0100 + + Typo in a comment (#1603) + +commit f4a7c5066c1921842a158976e349b4c6a6955d72 +Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> +Date: Thu Nov 28 19:51:34 2019 +0330 + + converting generator object to a list object (#1602) + + * converting generator object to a list object + + * Refactor: converting generator object to a list object + + * fixup! Format Python code with psf/black push + +commit 4baf3972e1fc8b8e366e509762e4731bb158f0f5 +Author: Christian Clauss +Date: Wed Nov 27 11:30:21 2019 +0100 + + GitHub Action to mark stale issues and pull requests (#1594) + +commit 140b79b4b2a184e041ce2e50e503d7a87b235b68 +Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> +Date: Tue Nov 26 15:27:53 2019 +0330 + + Adding Linear Discriminant Analysis (#1592) + + * Adding new file to the machine_learning directory + + * Adding initial documentation + + * importing modules + + * Adding Normal_gen function + + * Adding Y_gen function + + * Adding mean_calc function + + * Adding prob_calc function + + * Adding var_calc function + + * Adding predict function + + * Adding accuracy function + + * Adding main function + + * Renaming LDA file + + * Adding requested changes + + * Renaming some of functions + + * Refactoring str.format() statements to f-string + + * Removing unnecessary list objects inside two functions + + * changing code style in some lines + + * Fixing y_generator function + + * Refactoring 'predict_y_values' function by using list comprehensions + + * Changing code style in import statements + + * Refactoring CLI code block + + * fixup! Format Python code with psf/black push + + * No lines longer than 88 characters + +commit 0d3c9d586ca3e4642aa88e1bbf88a008993e0019 +Author: Vikas Kumar <54888022+vikasit12@users.noreply.github.com> +Date: Tue Nov 26 11:15:28 2019 +0530 + + Update singly_linked_list.py (#1593) + + * Update singly_linked_list.py + + printing current.data rather than node address in __repr__ for a more readable print statement + + * eval(repr(c)) == c + + The output of `__repr__()` _should look like a valid Python expression that could be used to recreate an object with the same value_. + + https://docs.python.org/3.4/reference/datamodel.html#object.__repr__ + + * += --> + + +commit 2ad5a1f0836f9d8b8da77457f163a183d98a0bda +Author: achance6 <45263295+achance6@users.noreply.github.com> +Date: Sat Nov 23 10:52:32 2019 -0500 + + Implemented simple keyword cipher (#1589) + + * Implemented simple keyword cipher + + * Added documentation and improved input processing + + * Allow object's hash function to be called + + * added to string functionality + + * reverted + + * Revised according to pull request #1589 + + * Optimized imports + + * Update simple_keyword_cypher.py + + * Update hash_table.py + +commit 4c75f863c84e049026135d5ae04e6969fc569add +Author: vansh bhardwaj <39709733+vansh1999@users.noreply.github.com> +Date: Sat Nov 23 18:24:06 2019 +0530 + + added current stock price (#1590) + + * added current stock price + + * Ten lines or less + +commit e09bf696488b83b090330c1baaf51ec938ed2d3a +Author: BryanChan777 <43082778+BryanChan777@users.noreply.github.com> +Date: Fri Nov 22 19:06:52 2019 -0800 + + Update README.md (#1588) + + * Update README.md + + * python -m unittest -v + +commit c5fd075f1ea9b6dc11cca2d36605aaddbd0ab5fa +Author: Arun Babu PT <36483987+ptarun@users.noreply.github.com> +Date: Fri Nov 22 20:25:19 2019 +0530 + + 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 + +commit ec7bc7c7cde95afbc8a7d7f826358cc221edfb6b +Author: Christian Clauss +Date: Thu Nov 21 15:21:40 2019 +0100 + + Tabs --> spaces in quine_mc_cluskey.py (#1426) + + * Tabs --> spaces in quine_mc_cluskey.py + + * fixup! Format Python code with psf/black push + +commit e8aa81297a6291a7d0994d71605f07d654aae17c +Author: Fakher Mokadem +Date: Wed Nov 20 06:36:32 2019 +0100 + + Update gaussian_filter.py (#1548) + + * Update gaussian_filter.py + + Changed embedded for loops with product. This way range(dst_height) is called only once, instead of being called $dst_height. + + * Update gaussian_filter.py + + fixed missing width + +commit 28c02a1f21b07627c98dd38e2cb933c1b9c14c6c +Author: John Law +Date: Tue Nov 19 13:52:55 2019 -0800 + + Improve bellman_ford.py (#1575) + + * Fix out of range error in bellman_ford.py + + * Update bellman_ford.py + + * fixup! Format Python code with psf/black push + + * Enhance the print function + + * fixup! Format Python code with psf/black push From d975c668a7556cd8a5a3336ff6601d854def58d0 Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Fri, 20 Dec 2019 20:08:53 +0530 Subject: [PATCH 14/15] changes made *integeration_by_simpson_approx.py --- DIRECTORY.md | 2 -- other/integeration_by_simpson_approx.py | 18 ++++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index b3f534952436..468fe65298d9 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -147,7 +147,6 @@ ## Dynamic Programming * [Abbreviation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/abbreviation.py) - * [All Submasks of Mask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/iterating_through_submasks.py) * [Bitmask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/bitmask.py) * [Climbing Stairs](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/climbing_stairs.py) * [Coin Change](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/coin_change.py) @@ -340,7 +339,6 @@ * [Frequency Finder](https://github.com/TheAlgorithms/Python/blob/master/other/frequency_finder.py) * [Game Of Life](https://github.com/TheAlgorithms/Python/blob/master/other/game_of_life.py) * [Greedy](https://github.com/TheAlgorithms/Python/blob/master/other/greedy.py) - * [Integeration](https://github.com/TheAlgorithms/Python/blob/master/other/integeration_by_simpson_approx.py) * [Largest Subarray Sum](https://github.com/TheAlgorithms/Python/blob/master/other/largest_subarray_sum.py) * [Least Recently Used](https://github.com/TheAlgorithms/Python/blob/master/other/least_recently_used.py) * [Linear Congruential Generator](https://github.com/TheAlgorithms/Python/blob/master/other/linear_congruential_generator.py) diff --git a/other/integeration_by_simpson_approx.py b/other/integeration_by_simpson_approx.py index dcc1a1345f31..2115ac9a5146 100644 --- a/other/integeration_by_simpson_approx.py +++ b/other/integeration_by_simpson_approx.py @@ -89,21 +89,19 @@ def simpson_integration(function, a: float, b: float, precision: int = 4) -> flo """ assert callable( function - ), "the function(object) passed should be callable your input : {}".format(function) + ), f"the function(object) passed should be callable your input : {function}" assert isinstance(a, float) or isinstance( a, int - ), "a should be float or integer your input : {}".format(a) + ), f"a should be float or integer your input : {a}" assert isinstance(function(a), float) or isinstance( function(a), int - ), "the function should return integer or float return type of your function, {}".format( - type(function(a)) - ) + ), f"the function should return integer or float return type of your function, {type(a)}" assert isinstance(b, float) or isinstance( b, int - ), "b should be float or integer your input : {}".format(b) + ), f"b should be float or integer your input : {b}" assert ( isinstance(precision, int) and precision > 0 - ), "precision should be positive integer your input : {}".format(precision) + ), f"precision should be positive integer your input : {precision}" # just applying the formula of simpson for approximate integraion written in # mentioned article in first comment of this file and above this function @@ -113,11 +111,7 @@ def simpson_integration(function, a: float, b: float, precision: int = 4) -> flo for i in range(1, N_STEPS): a1 = a + h * i - - if i % 2: - result += function(a1) * 4 - else: - result += function(a1) * 2 + result += function(a1) * (4 if i%2 else 2) result *= h / 3 return round(result, precision) From c1b907dd5eb6e7087ba20942b5aea3a83471813a Mon Sep 17 00:00:00 2001 From: faizan2700 Date: Fri, 20 Dec 2019 20:15:31 +0530 Subject: [PATCH 15/15] update2 --- diff | 578 ----------------------------------------------------------- 1 file changed, 578 deletions(-) delete mode 100644 diff diff --git a/diff b/diff deleted file mode 100644 index 49ce64441717..000000000000 --- a/diff +++ /dev/null @@ -1,578 +0,0 @@ -commit b3946094a78e1ccbcddf80130082ef76a0e000d0 (HEAD -> master, origin/master, origin/HEAD) -Author: faizan2700 -Date: Wed Dec 18 10:38:21 2019 +0530 - - iterating_through_submasks.py is added in dynamic_programming - -commit 00351ca8992cc9b8a959274861a25d19123e81ba -Author: faizan2700 -Date: Wed Dec 18 10:27:19 2019 +0530 - - iterating_through_submasks is added with doctests - -commit 6e484d8e7ca1cd13af0c6e901d8a23d34acf2ae5 -Author: faizan2700 -Date: Tue Dec 17 22:56:06 2019 +0530 - - *iterating_through_submasks.py is added in dynamic_programming - -commit ac5b41ca40b4713619b836b513c0116ddcc33848 -Author: faizan2700 -Date: Tue Dec 17 22:48:50 2019 +0530 - - no changes - -commit 01121afa65ed6a175a3e976515ed604e90a1623f -Author: faizan2700 -Date: Tue Dec 17 22:44:44 2019 +0530 - - new file *iterating_through_submasks* is added in dynamic_programming section - -commit f4779bc04ae706b0c548e2fe6d7a59efe8b85524 -Author: Rohit Joshi <34398948+rohitjoshi21@users.noreply.github.com> -Date: Sun Dec 15 13:12:07 2019 +0545 - - Bug Fixed in newton_raphson_method.py (#1634) - - * Bug Fixed - - * Fixed newton_raphson_method.py - - * Fixed newton_raphson_method.py 2 - - * Fixed newton_raphson_method.py 3 - - * Fixed newton_raphson_method.py 4 - - * Fixed newton_raphson_method.py 5 - - * Fixed newton_raphson_method.py 6 - - * Update newton_raphson_method.py - - * Update newton_raphson_method.py - - * # noqa: F401, F403 - - * newton_raphson - - * newton_raphson - - * precision: int=10 ** -10 - - * return float(x) - - * 3.1415926536808043 - - * Update newton_raphson_method.py - - * 2.23606797749979 - - * Update newton_raphson_method.py - - * Rename newton_raphson_method.py to newton_raphson.py - -commit bc5b92f7f9de09bbaba96cd7fc8b2853dc0c080c -Author: Muhammad Ibtihaj Naeem -Date: Sat Dec 14 10:46:02 2019 +0500 - - Harmonic Geometric and P-Series Added (#1633) - - * Harmonic Geometric and P-Series Added - - * Editing comments - - * Update and rename series/Geometric_Series.py to maths/series/geometric_series.py - - * Update and rename series/Harmonic_Series.py to maths/series/harmonic_series.py - - * Update and rename series/P_Series.py to maths/series/p_series.py - -commit d385472c6fe5abda18759f89e81efe1f0bf6da0f -Author: heartsmoking <327899144@qq.com> -Date: Wed Dec 11 14:57:08 2019 +0800 - - Update find_min.py (#1627) - - Line 5: :return: max number in list - "max" must be "min" - -commit b9bff8f3a72427b5d2ae3f2f174dc5db11df0d50 -Author: Christian Clauss -Date: Tue Dec 10 15:53:50 2019 +0100 - - Remove \r from strings (#1622) - - * Remove \r from strings - - * Satisfy tensorflow with numpy>=1.17.4 - -commit 1cbeaa252ad5822c9197b385a99e550f7aa2f897 -Author: Binish Manandhar <37204996+binish784@users.noreply.github.com> -Date: Tue Dec 10 12:37:40 2019 +0545 - - Image processing algorithms added (#616) - - * Image processing algorithms added - - * Example images included - - * Issues resolved - - * class added - - * Naming issues fixes - - * Create file_path - -commit 9316618611967c26b98ce275fab238f735f2864e -Author: Shoaib Asgar -Date: Mon Dec 9 07:59:01 2019 +0530 - - digital_image_processing/convert_to_negative (#1216) - - * digital_image_processing/convert_to_negative - - * added doc - - * added test code - - * Update convert_to_negative.py - -commit 02b717e364cd6623e303d4cc2378d1448779dc2b -Author: Samarth Sehgal -Date: Mon Dec 9 09:43:56 2019 +1100 - - Update odd_even_transposition_parallel.py (#1458) - - * Update odd_even_transposition_parallel.py - - * arr = OddEvenTransposition(arr) - -commit 74d96ab3558120b6810aa3f613e091774aefeca3 -Author: Jawpral <34590600+Jawpral@users.noreply.github.com> -Date: Mon Dec 9 03:57:42 2019 +0530 - - Fixed issue #1368 (#1482) - - * Changed as suggested - - Now return in same format as oct() returns - - * Slight change - - * Fixed issue #1368, return values for large number now is fixed and does not return in scientific notation - - * Update decimal_to_octal.py - -commit 43905efe298172e9e9280661d80af8f7e2105517 -Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> -Date: Mon Dec 9 01:45:17 2019 +0330 - - Adding doctests into LDA algorithm (#1621) - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * Adding doctests into function - - * fixup! Format Python code with psf/black push - - * Update convex_hull.py - - * Update convex_hull.py - -commit 26b0803319b6cf14f623769356c79343e3d43d14 -Author: Christian Clauss -Date: Sun Dec 8 22:42:17 2019 +0100 - - 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 - -commit 9eb50cc223f7a8da8d7299bf4db8e4d3313b8bff -Author: GeorgeChambi -Date: Sat Dec 7 05:39:59 2019 +0000 - - Improved readability (#1615) - - * improved readability - - * further readability improvements - - * removed csv file and added f - -commit 938dd0bbb5145aa7c60127745ae0571cb20a2387 -Author: Níkolas Vargas -Date: Sat Dec 7 02:39:08 2019 -0300 - - improved prime numbers implementation (#1606) - - * improved prime numbers implementation - - * fixup! Format Python code with psf/black push - - * fix type hint - - * fixup! Format Python code with psf/black push - - * fix doctests - - * updating DIRECTORY.md - - * added prime tests with negative numbers - - * using for instead filter - - * updating DIRECTORY.md - - * Remove unused typing.List - - * Remove tab indentation - - * print("Sorted order is:", " ".join(a)) - -commit ccc1ff2ce89af2a569f1fbfa16ff70ad22ed9e89 -Author: SHAKTI SINGH -Date: Fri Dec 6 12:04:21 2019 +0530 - - pigeonhole sorting in python (#364) - - * pigeonhole sorting in python - - * variable name update in pigeonhole_sort.py - - * Add doctest - -commit 3cfca42f17e4e5f3d31da30eb80f7c0baa66eb4b -Author: João Gustavo A. Amorim -Date: Fri Dec 6 03:13:10 2019 -0300 - - add the index calculation class at digital_image_processing and the hamming code algorithm at hashes (#1152) - - * add the index calculation at difital_image_processing file - - * make changes at index_calculation - - * update the variables to self variables at functions - - * update the word wrap in comments at index_calculation - - * add the hamming code algorithm - - * Wrap long lines - -commit 494fb4fb490c49d46c693933c5583ac2fb4f665b -Author: Bardia Alavi -Date: Wed Dec 4 23:06:41 2019 -0500 - - address merge_soft duplicate files (#1612) - - Here the old file merge_sort_fastest is renamed to unknown_sort. Because it is not merge sort algorithm. - - Comments are updated accordingly. - -commit caad74466aaa6a98465e10bd7adf828482d2de63 -Author: QuantumNovice <43876848+QuantumNovice@users.noreply.github.com> -Date: Tue Dec 3 16:17:42 2019 +0500 - - Added Multilayer Perceptron (sklearn) (#1609) - - * Added Multilayer Perceptron ( sklearn) - - * Rename MLPClassifier.py to multilayer_preceptron_classifier.py - - * Rename multilayer_preceptron_classifier.py to multilayer_perceptron_classifier.py - - * Update multilayer_perceptron_classifier.py - -commit 8ffc4f8706dc5ecb7cd015839f1cb92997217c63 -Author: GeorgeChambi -Date: Tue Dec 3 11:14:30 2019 +0000 - - fixed bug (#1610) - - Removed comma from print statement causing and error. - -commit 74aeaa333f81912b696e0cf069e4993bc94113cc -Author: Abhijit Patil -Date: Sun Dec 1 11:28:25 2019 +0530 - - Code for Eulers Totient function (#1229) - - * Create eulersTotient.py - - * Rename eulersTotient.py to eulers_totient.py - - * Update eulers_totient.py - -commit 4dca9571dba5b6d0ce31fe49e8928451573a34af -Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> -Date: Sun Dec 1 02:29:23 2019 -0300 - - Pythagoras (#1243) - - * add pythagoras.py - - * function distance - - * run as script - - * Update pythagoras.py - -commit 415c9f5e6547457eb3546b467283cbd9e82e4eec -Author: Bruno Santos <7022432+dunderbruno@users.noreply.github.com> -Date: Sun Dec 1 02:13:28 2019 -0300 - - Improve prim.py (#1226) - - * suiting PEP8 - - * create auxiliary function - - * running example - - * updating DIRECTORY.md - -commit 5d20dbfb98a19634db0961318f5378f50e94c428 -Author: Saurabh Goyal -Date: Sat Nov 30 10:47:13 2019 +0530 - - add a generic heap (#906) - - * add a generic heap - - * Delete __init__.py - - * Rename data_structures/Heap/heap_generic.py to data_structures/heap/heap_generic.py - - * Add doctests - - * Fix doctests - - * Fix doctests again - -commit 2fb6f786ceff9fef94494d73d541a4e7e5feafed -Author: Christian Clauss -Date: Thu Nov 28 19:53:37 2019 +0100 - - Typo in a comment (#1603) - -commit f4a7c5066c1921842a158976e349b4c6a6955d72 -Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> -Date: Thu Nov 28 19:51:34 2019 +0330 - - converting generator object to a list object (#1602) - - * converting generator object to a list object - - * Refactor: converting generator object to a list object - - * fixup! Format Python code with psf/black push - -commit 4baf3972e1fc8b8e366e509762e4731bb158f0f5 -Author: Christian Clauss -Date: Wed Nov 27 11:30:21 2019 +0100 - - GitHub Action to mark stale issues and pull requests (#1594) - -commit 140b79b4b2a184e041ce2e50e503d7a87b235b68 -Author: ELNS <57490926+EverLookNeverSee@users.noreply.github.com> -Date: Tue Nov 26 15:27:53 2019 +0330 - - Adding Linear Discriminant Analysis (#1592) - - * Adding new file to the machine_learning directory - - * Adding initial documentation - - * importing modules - - * Adding Normal_gen function - - * Adding Y_gen function - - * Adding mean_calc function - - * Adding prob_calc function - - * Adding var_calc function - - * Adding predict function - - * Adding accuracy function - - * Adding main function - - * Renaming LDA file - - * Adding requested changes - - * Renaming some of functions - - * Refactoring str.format() statements to f-string - - * Removing unnecessary list objects inside two functions - - * changing code style in some lines - - * Fixing y_generator function - - * Refactoring 'predict_y_values' function by using list comprehensions - - * Changing code style in import statements - - * Refactoring CLI code block - - * fixup! Format Python code with psf/black push - - * No lines longer than 88 characters - -commit 0d3c9d586ca3e4642aa88e1bbf88a008993e0019 -Author: Vikas Kumar <54888022+vikasit12@users.noreply.github.com> -Date: Tue Nov 26 11:15:28 2019 +0530 - - Update singly_linked_list.py (#1593) - - * Update singly_linked_list.py - - printing current.data rather than node address in __repr__ for a more readable print statement - - * eval(repr(c)) == c - - The output of `__repr__()` _should look like a valid Python expression that could be used to recreate an object with the same value_. - - https://docs.python.org/3.4/reference/datamodel.html#object.__repr__ - - * += --> + - -commit 2ad5a1f0836f9d8b8da77457f163a183d98a0bda -Author: achance6 <45263295+achance6@users.noreply.github.com> -Date: Sat Nov 23 10:52:32 2019 -0500 - - Implemented simple keyword cipher (#1589) - - * Implemented simple keyword cipher - - * Added documentation and improved input processing - - * Allow object's hash function to be called - - * added to string functionality - - * reverted - - * Revised according to pull request #1589 - - * Optimized imports - - * Update simple_keyword_cypher.py - - * Update hash_table.py - -commit 4c75f863c84e049026135d5ae04e6969fc569add -Author: vansh bhardwaj <39709733+vansh1999@users.noreply.github.com> -Date: Sat Nov 23 18:24:06 2019 +0530 - - added current stock price (#1590) - - * added current stock price - - * Ten lines or less - -commit e09bf696488b83b090330c1baaf51ec938ed2d3a -Author: BryanChan777 <43082778+BryanChan777@users.noreply.github.com> -Date: Fri Nov 22 19:06:52 2019 -0800 - - Update README.md (#1588) - - * Update README.md - - * python -m unittest -v - -commit c5fd075f1ea9b6dc11cca2d36605aaddbd0ab5fa -Author: Arun Babu PT <36483987+ptarun@users.noreply.github.com> -Date: Fri Nov 22 20:25:19 2019 +0530 - - 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 - -commit ec7bc7c7cde95afbc8a7d7f826358cc221edfb6b -Author: Christian Clauss -Date: Thu Nov 21 15:21:40 2019 +0100 - - Tabs --> spaces in quine_mc_cluskey.py (#1426) - - * Tabs --> spaces in quine_mc_cluskey.py - - * fixup! Format Python code with psf/black push - -commit e8aa81297a6291a7d0994d71605f07d654aae17c -Author: Fakher Mokadem -Date: Wed Nov 20 06:36:32 2019 +0100 - - Update gaussian_filter.py (#1548) - - * Update gaussian_filter.py - - Changed embedded for loops with product. This way range(dst_height) is called only once, instead of being called $dst_height. - - * Update gaussian_filter.py - - fixed missing width - -commit 28c02a1f21b07627c98dd38e2cb933c1b9c14c6c -Author: John Law -Date: Tue Nov 19 13:52:55 2019 -0800 - - Improve bellman_ford.py (#1575) - - * Fix out of range error in bellman_ford.py - - * Update bellman_ford.py - - * fixup! Format Python code with psf/black push - - * Enhance the print function - - * fixup! Format Python code with psf/black push