From bc437e48129fd747afba2f783d3c62cb15ae9b43 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 11:33:39 +0200 Subject: [PATCH 01/36] Travis CI: Add type checking with mypy --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8676e5127334..85da3af12848 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: python dist: xenial # required for Python >= 3.7 python: 3.7 -install: pip install flake8 -script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics +install: pip install flake8 mypy +before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics +script: mypy . From 5dd8090680f70ccbfebb9c84a88a4fde4607d690 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 11:38:43 +0200 Subject: [PATCH 02/36] Create requirements.txt --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000000..da4a8cd99573 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +# for digital_image_processing +cv2 +numpy From d3d5a39f36cebe383fed1aea5571456278136de3 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 11:44:11 +0200 Subject: [PATCH 03/36] script: mypy --ignore-missing-stubs=cv2,numpy . --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 85da3af12848..6a81eb907ed8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ dist: xenial # required for Python >= 3.7 python: 3.7 install: pip install flake8 mypy before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -script: mypy . +script: mypy --ignore-missing-stubs=cv2,numpy . From 3f32aa842a9cc5e26fd6b119ba5e75ae6c6aa74a Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 11:44:22 +0200 Subject: [PATCH 04/36] Delete requirements.txt --- requirements.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index da4a8cd99573..000000000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -# for digital_image_processing -cv2 -numpy From ed1e00ab20aa2039fb5f7304d2e8750b19200a8c Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 11:52:07 +0200 Subject: [PATCH 05/36] script: mypy --ignore-missing-imports . --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6a81eb907ed8..c31e7c0e2336 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ dist: xenial # required for Python >= 3.7 python: 3.7 install: pip install flake8 mypy before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -script: mypy --ignore-missing-stubs=cv2,numpy . +script: mypy --ignore-missing-imports . From 6950950683107852a4b870b1a5db5e8b51757ad2 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 12:24:02 +0200 Subject: [PATCH 06/36] Run doctests --- .travis.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c31e7c0e2336..7b06bdbd9e54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,23 @@ dist: xenial # required for Python >= 3.7 python: 3.7 install: pip install flake8 mypy before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -script: mypy --ignore-missing-imports . +script: + - python -m doctest -v ciphers/affine_cipher.py + - python -m doctest -v ciphers/brute_force_caesar_cipher.py + - python -m doctest -v ciphers/transposition_cipher.py + - python -m doctest -v other/detecting_english_programmatically.py + - python -m doctest -v other/frequency_finder.py + - python -m doctest -v searches/binary_search.py + - python -m doctest -v searches/linear_search.py + - python -m doctest -v searches/sentinel_linear_search.py + - python -m doctest -v sorts/bogo_sort.py + - python -m doctest -v sorts/comb_sort.py + - python -m doctest -v sorts/counting_sort.py + - python -m doctest -v sorts/heap_sort.py + - python -m doctest -v sorts/insertion_sort.py + - python -m doctest -v sorts/merge_sort.py + - python -m doctest -v sorts/quick_sort.py + - python -m doctest -v sorts/selection_sort.py + - python -m doctest -v sorts/shell_sort.py + - python -m doctest -v strings/levenshtein_distance.py + - mypy --ignore-missing-imports . From d612c3a7ab6faa59a5cc17a33f5adcb803cde895 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 12:28:33 +0200 Subject: [PATCH 07/36] Disable doctest -v other/detecting_english_programmatically.py --- .travis.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b06bdbd9e54..e67ef1202147 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,22 +4,22 @@ python: 3.7 install: pip install flake8 mypy before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics script: - - python -m doctest -v ciphers/affine_cipher.py - - python -m doctest -v ciphers/brute_force_caesar_cipher.py - - python -m doctest -v ciphers/transposition_cipher.py - - python -m doctest -v other/detecting_english_programmatically.py - - python -m doctest -v other/frequency_finder.py - - python -m doctest -v searches/binary_search.py - - python -m doctest -v searches/linear_search.py - - python -m doctest -v searches/sentinel_linear_search.py - - python -m doctest -v sorts/bogo_sort.py - - python -m doctest -v sorts/comb_sort.py - - python -m doctest -v sorts/counting_sort.py - - python -m doctest -v sorts/heap_sort.py - - python -m doctest -v sorts/insertion_sort.py - - python -m doctest -v sorts/merge_sort.py - - python -m doctest -v sorts/quick_sort.py - - python -m doctest -v sorts/selection_sort.py - - python -m doctest -v sorts/shell_sort.py - - python -m doctest -v strings/levenshtein_distance.py + - python -m doctest ciphers/affine_cipher.py + - python -m doctest ciphers/brute_force_caesar_cipher.py + - python -m doctest ciphers/transposition_cipher.py + # - python -m doctest other/detecting_english_programmatically.py + - python -m doctest other/frequency_finder.py + - python -m doctest searches/binary_search.py + - python -m doctest searches/linear_search.py + - python -m doctest searches/sentinel_linear_search.py + - python -m doctest sorts/bogo_sort.py + - python -m doctest sorts/comb_sort.py + - python -m doctest sorts/counting_sort.py + - python -m doctest sorts/heap_sort.py + - python -m doctest sorts/insertion_sort.py + - python -m doctest sorts/merge_sort.py + - python -m doctest sorts/quick_sort.py + - python -m doctest sorts/selection_sort.py + - python -m doctest sorts/shell_sort.py + - python -m doctest strings/levenshtein_distance.py - mypy --ignore-missing-imports . From 6846fcc71aac3bf93935097dae8aa62dd193aec3 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 12:44:48 +0200 Subject: [PATCH 08/36] Pytest --- .travis.yml | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index e67ef1202147..659be4f173dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,27 @@ language: python dist: xenial # required for Python >= 3.7 python: 3.7 -install: pip install flake8 mypy +install: pip install flake8 mypy pytest before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics script: - - python -m doctest ciphers/affine_cipher.py - - python -m doctest ciphers/brute_force_caesar_cipher.py - - python -m doctest ciphers/transposition_cipher.py # - python -m doctest other/detecting_english_programmatically.py - - python -m doctest other/frequency_finder.py - - python -m doctest searches/binary_search.py - - python -m doctest searches/linear_search.py - - python -m doctest searches/sentinel_linear_search.py - - python -m doctest sorts/bogo_sort.py - - python -m doctest sorts/comb_sort.py - - python -m doctest sorts/counting_sort.py - - python -m doctest sorts/heap_sort.py - - python -m doctest sorts/insertion_sort.py - - python -m doctest sorts/merge_sort.py - - python -m doctest sorts/quick_sort.py - - python -m doctest sorts/selection_sort.py - - python -m doctest sorts/shell_sort.py - - python -m doctest strings/levenshtein_distance.py + - python -m doctest | + ciphers/affine_cipher.py + ciphers/brute_force_caesar_cipher.py + ciphers/transposition_cipher.py + other/frequency_finder.py + searches/binary_search.py + searches/linear_search.py + searches/sentinel_linear_search.py + sorts/bogo_sort.py + sorts/comb_sort.py + sorts/counting_sort.py + sorts/heap_sort.py + sorts/insertion_sort.py + sorts/merge_sort.py + sorts/quick_sort.py + sorts/selection_sort.py + sorts/shell_sort.py + strings/levenshtein_distance.py - mypy --ignore-missing-imports . + - pytest From 9c7f9dacda91a2e12ea5fd9fe43b67dc6c5a4c9e Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 12:48:40 +0200 Subject: [PATCH 09/36] No | --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 659be4f173dc..a899a1c715c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ install: pip install flake8 mypy pytest before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics script: # - python -m doctest other/detecting_english_programmatically.py - - python -m doctest | + - python -m doctest ciphers/affine_cipher.py ciphers/brute_force_caesar_cipher.py ciphers/transposition_cipher.py From d371f76d0c88a8d5c08964e3fb486f81c384efbe Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 12:51:19 +0200 Subject: [PATCH 10/36] pytest || true --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a899a1c715c3..385856d9f34a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: python dist: xenial # required for Python >= 3.7 python: 3.7 +cache: pip install: pip install flake8 mypy pytest before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics script: @@ -24,4 +25,4 @@ script: sorts/shell_sort.py strings/levenshtein_distance.py - mypy --ignore-missing-imports . - - pytest + - pytest || true From 276b248f46e43d4258c5a65f18f10c02507f46af Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 12:56:43 +0200 Subject: [PATCH 11/36] Run black doctest flake8 mypy pytest --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 385856d9f34a..eed0780d9daf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,10 @@ language: python dist: xenial # required for Python >= 3.7 python: 3.7 cache: pip -install: pip install flake8 mypy pytest -before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -script: +install: pip install black flake8 mypy pytest +before_script: + - black --check . || true + - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # - python -m doctest other/detecting_english_programmatically.py - python -m doctest ciphers/affine_cipher.py @@ -24,5 +25,6 @@ script: sorts/selection_sort.py sorts/shell_sort.py strings/levenshtein_distance.py +script: - mypy --ignore-missing-imports . - pytest || true From 5ca5b43f3370c13158cfaed7c51281204b62964c Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 15:41:01 +0200 Subject: [PATCH 12/36] after_success: Build Directory.md --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eed0780d9daf..2691ad385716 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,11 @@ install: pip install black flake8 mypy pytest before_script: - black --check . || true - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # - python -m doctest other/detecting_english_programmatically.py - python -m doctest ciphers/affine_cipher.py ciphers/brute_force_caesar_cipher.py ciphers/transposition_cipher.py + other/detecting_english_programmatically.py other/frequency_finder.py searches/binary_search.py searches/linear_search.py @@ -28,3 +28,6 @@ before_script: script: - mypy --ignore-missing-imports . - pytest || true +after_success: + - python ./~script.py + - cat DIRECTORY.md From 5ad53a735cea7790a149c6fe31ee7e7ab90202d4 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 15:43:33 +0200 Subject: [PATCH 13/36] Typo in filename: Dictionary.txt --> dictionary.txt' Discovered via doctest run in #964 --- other/detecting_english_programmatically.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/detecting_english_programmatically.py b/other/detecting_english_programmatically.py index 005fd3c10ca3..8b73ff6cf0c3 100644 --- a/other/detecting_english_programmatically.py +++ b/other/detecting_english_programmatically.py @@ -6,7 +6,7 @@ def loadDictionary(): path = os.path.split(os.path.realpath(__file__)) englishWords = {} - with open(path[0] + '/Dictionary.txt') as dictionaryFile: + with open(path[0] + '/dictionary.txt') as dictionaryFile: for word in dictionaryFile.read().split('\n'): englishWords[word] = None return englishWords From 047216f99d8df315100d96f50061aa046f267d7e Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 15:47:14 +0200 Subject: [PATCH 14/36] python -m doctest -v --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2691ad385716..8832ac7ea62e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ install: pip install black flake8 mypy pytest before_script: - black --check . || true - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - - python -m doctest + - python -m doctest -v ciphers/affine_cipher.py ciphers/brute_force_caesar_cipher.py ciphers/transposition_cipher.py From bd027657455de3aecf29951c10a22d0528751e95 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 16:03:54 +0200 Subject: [PATCH 15/36] pip install black flake8 mypy pytest --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8832ac7ea62e..ac9b4abb1241 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,11 @@ install: pip install black flake8 mypy pytest before_script: - black --check . || true - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - - python -m doctest -v + # - python -m doctest -v other/detecting_english_programmatically.py + - python -m doctest ciphers/affine_cipher.py ciphers/brute_force_caesar_cipher.py ciphers/transposition_cipher.py - other/detecting_english_programmatically.py other/frequency_finder.py searches/binary_search.py searches/linear_search.py From 9994794bced56f946a742c9bbc8f7758510e5d87 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:13:17 +0200 Subject: [PATCH 16/36] pytest --doctest-glob='*.py' --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ac9b4abb1241..15963a467394 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_script: strings/levenshtein_distance.py script: - mypy --ignore-missing-imports . - - pytest || true + - pytest --doctest-glob='*.py' || true after_success: - python ./~script.py - cat DIRECTORY.md From 86bdb71527105fdced56766540242306106428d7 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:22:21 +0200 Subject: [PATCH 17/36] pytest --doctest-modules --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 15963a467394..8ea70096917d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_script: strings/levenshtein_distance.py script: - mypy --ignore-missing-imports . - - pytest --doctest-glob='*.py' || true + - pytest --doctest-modules || true after_success: - python ./~script.py - cat DIRECTORY.md From 19b45dd242d287113356a6591eb3be71ea9e8d65 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:32:01 +0200 Subject: [PATCH 18/36] pytest --doctest-modules ./sorts --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8ea70096917d..e1e9ce6a4a32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_script: strings/levenshtein_distance.py script: - mypy --ignore-missing-imports . - - pytest --doctest-modules || true + - pytest --doctest-modules ./sorts || true after_success: - python ./~script.py - cat DIRECTORY.md From 5a1a3980670edad2d1969e8e5a5ad8ede646587a Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:36:36 +0200 Subject: [PATCH 19/36] pytest --doctest-modules ./ciphers ./other ./searches ./sorts ./strings || true --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e1e9ce6a4a32..46cd85291d92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_script: strings/levenshtein_distance.py script: - mypy --ignore-missing-imports . - - pytest --doctest-modules ./sorts || true + - pytest --doctest-modules ./ciphers ./other ./searches ./sorts ./strings || true after_success: - python ./~script.py - cat DIRECTORY.md From a37327d5cf2a19a5a4cbb93f14311365bf135ab7 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:40:40 +0200 Subject: [PATCH 20/36] if __name__ == "__main__": --- sorts/Bitonic_Sort.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sorts/Bitonic_Sort.py b/sorts/Bitonic_Sort.py index bae95b4346f6..ba40a1f698ee 100644 --- a/sorts/Bitonic_Sort.py +++ b/sorts/Bitonic_Sort.py @@ -42,15 +42,16 @@ def sort(a, N, up): bitonicSort(a, 0, N, up) -# Driver code to test above -a = [] - -n = int(input()) -for i in range(n): - a.append(int(input())) -up = 1 - -sort(a, n, up) -print("\n\nSorted array is") -for i in range(n): - print("%d" % a[i]) +if __name__ == "__main__": + # Driver code to test above + a = [] + + n = int(input().strip()) + for i in range(n): + a.append(int(input().strip())) + up = 1 + + sort(a, n, up) + print("\n\nSorted array is") + for i in range(n): + print("%d" % a[i]) From 002287dcf9f3b0293dd26c2e971099cd94d6ee8b Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:44:10 +0200 Subject: [PATCH 21/36] if __name__ == "__main__": --- other/sierpinski_triangle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/other/sierpinski_triangle.py b/other/sierpinski_triangle.py index 329a8ce5c43f..bcc7ea6ce6c8 100644 --- a/other/sierpinski_triangle.py +++ b/other/sierpinski_triangle.py @@ -64,4 +64,5 @@ def triangle(points,depth): depth-1) -triangle(points,int(sys.argv[1])) +if __name__ == "__main__": + triangle(points,int(sys.argv[1])) From cec7e1626feb42e6165f2f2c2a84059af82d6bca Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:47:27 +0200 Subject: [PATCH 22/36] if __name__ == '__main__': --- ciphers/caesar_cipher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ciphers/caesar_cipher.py b/ciphers/caesar_cipher.py index 39c069c95a7c..008883765642 100644 --- a/ciphers/caesar_cipher.py +++ b/ciphers/caesar_cipher.py @@ -60,4 +60,7 @@ def main(): elif choice == '4': print ("Goodbye.") break -main() + + +if __name__ == '__main__': + main() From 28d9e6d09202509cbc73c7635b6fb78bffedcfb8 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:48:06 +0200 Subject: [PATCH 23/36] if __name__ == '__main__': --- ciphers/Atbash.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ciphers/Atbash.py b/ciphers/Atbash.py index 162614c727ee..f24f3713ec59 100644 --- a/ciphers/Atbash.py +++ b/ciphers/Atbash.py @@ -18,4 +18,5 @@ def Atbash(): output+=i print(output) -Atbash() +if __name__ == '__main__': + Atbash() From 1c27abc4e2d01bcce7c076f3378dcc2227258ff6 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:48:27 +0200 Subject: [PATCH 24/36] if __name__ == '__main__': --- ciphers/Atbash.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ciphers/Atbash.py b/ciphers/Atbash.py index f24f3713ec59..5653f0213745 100644 --- a/ciphers/Atbash.py +++ b/ciphers/Atbash.py @@ -18,5 +18,6 @@ def Atbash(): output+=i print(output) + if __name__ == '__main__': Atbash() From 704bf00dfcfdc9dea8d2f4550b705f0a2e4af641 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:49:46 +0200 Subject: [PATCH 25/36] Create requirements.txt --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000000..db5d81e01ea6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +matplotlib +numpy From 34563161ddddaa9bef28369322514b10f16f6cf3 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:54:09 +0200 Subject: [PATCH 26/36] Update requirements.txt --- requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/requirements.txt b/requirements.txt index db5d81e01ea6..30179ac345b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,6 @@ +black +flake8 matplotlib +mypy numpy +pytest From 769f66db26cb90e04534ca37b5bea2f057f27de9 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:56:38 +0200 Subject: [PATCH 27/36] if __name__ == "__main__": --- other/sierpinski_triangle.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/other/sierpinski_triangle.py b/other/sierpinski_triangle.py index bcc7ea6ce6c8..be068749240b 100644 --- a/other/sierpinski_triangle.py +++ b/other/sierpinski_triangle.py @@ -27,8 +27,6 @@ import turtle import sys PROGNAME = 'Sierpinski Triangle' -if len(sys.argv) !=2: - raise Exception('right format for using this script: $python fractals.py ') myPen = turtle.Turtle() myPen.ht() @@ -65,4 +63,7 @@ def triangle(points,depth): if __name__ == "__main__": + if len(sys.argv) !=2: + raise ValueError('right format for using this script: ' + '$python fractals.py ') triangle(points,int(sys.argv[1])) From 122bf27a65c111c87bcd942938db89642a29d93a Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 18:57:33 +0200 Subject: [PATCH 28/36] Lose the doctests --- .travis.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 46cd85291d92..6d7537be3247 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,29 +2,10 @@ language: python dist: xenial # required for Python >= 3.7 python: 3.7 cache: pip -install: pip install black flake8 mypy pytest +install: pip install -r requirements.txt before_script: - black --check . || true - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # - python -m doctest -v other/detecting_english_programmatically.py - - python -m doctest - ciphers/affine_cipher.py - ciphers/brute_force_caesar_cipher.py - ciphers/transposition_cipher.py - other/frequency_finder.py - searches/binary_search.py - searches/linear_search.py - searches/sentinel_linear_search.py - sorts/bogo_sort.py - sorts/comb_sort.py - sorts/counting_sort.py - sorts/heap_sort.py - sorts/insertion_sort.py - sorts/merge_sort.py - sorts/quick_sort.py - sorts/selection_sort.py - sorts/shell_sort.py - strings/levenshtein_distance.py script: - mypy --ignore-missing-imports . - pytest --doctest-modules ./ciphers ./other ./searches ./sorts ./strings || true From 9ae08f37a429317ad98483f0f6fcebba101fd839 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 19:02:08 +0200 Subject: [PATCH 29/36] if __name__ == '__main__': --- other/sierpinski_triangle.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/other/sierpinski_triangle.py b/other/sierpinski_triangle.py index be068749240b..fc22aad96059 100644 --- a/other/sierpinski_triangle.py +++ b/other/sierpinski_triangle.py @@ -28,11 +28,6 @@ import sys PROGNAME = 'Sierpinski Triangle' -myPen = turtle.Turtle() -myPen.ht() -myPen.speed(5) -myPen.pencolor('red') - points = [[-175,-125],[0,175],[175,-125]] #size of triangle def getMid(p1,p2): @@ -62,8 +57,12 @@ def triangle(points,depth): depth-1) -if __name__ == "__main__": +if __name__ == '__main__': if len(sys.argv) !=2: raise ValueError('right format for using this script: ' '$python fractals.py ') + myPen = turtle.Turtle() + myPen.ht() + myPen.speed(5) + myPen.pencolor('red') triangle(points,int(sys.argv[1])) From 03b4bddf411fe4b23ceed48af472321bd4bb7a27 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 19:06:22 +0200 Subject: [PATCH 30/36] Remove print-a-tuple --- other/tower_of_hanoi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/other/tower_of_hanoi.py b/other/tower_of_hanoi.py index dc15b2ce8e58..9cc5b9e40543 100644 --- a/other/tower_of_hanoi.py +++ b/other/tower_of_hanoi.py @@ -16,10 +16,10 @@ def moveTower(height, fromPole, toPole, withPole): moveTower(height-1, withPole, toPole, fromPole) def moveDisk(fp,tp): - print(('moving disk from', fp, 'to', tp)) + print('moving disk from', fp, 'to', tp) def main(): - height = int(input('Height of hanoi: ')) + height = int(input('Height of hanoi: ').strip()) moveTower(height, 'A', 'B', 'C') if __name__ == '__main__': From 8b55aff81023348c8b018522c6b703d157498221 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 19:09:49 +0200 Subject: [PATCH 31/36] doctest: Added missing spaces --- sorts/bubble_sort.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorts/bubble_sort.py b/sorts/bubble_sort.py index e17fc3358d53..4e2c19b65e02 100644 --- a/sorts/bubble_sort.py +++ b/sorts/bubble_sort.py @@ -19,7 +19,7 @@ def bubble_sort(collection): [-45, -5, -2] >>> bubble_sort([-23,0,6,-4,34]) - [-23,-4,0,6,34] + [-23, -4, 0, 6, 34] """ length = len(collection) for i in range(length-1): From 33a8723ca037b0cb6ef095f2884c277bfa0e341b Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 19:19:47 +0200 Subject: [PATCH 32/36] Update tabu_search.py --- searches/tabu_search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/searches/tabu_search.py b/searches/tabu_search.py index e21ddd53cc78..4c9b4ba4d443 100644 --- a/searches/tabu_search.py +++ b/searches/tabu_search.py @@ -38,7 +38,7 @@ def generate_neighbours(path): and the cost (distance) for each neighbor. Example of dict_of_neighbours: - >>> dict_of_neighbours[a] + >>) dict_of_neighbours[a] [[b,20],[c,18],[d,22],[e,26]] This indicates the neighbors of node (city) 'a', which has neighbor the node 'b' with distance 20, @@ -130,7 +130,8 @@ def find_neighborhood(solution, dict_of_neighbours): Example: - >>> find_neighborhood(['a','c','b','d','e','a']) + >>> dict_of_neighbours = {} + >>> find_neighborhood(['a','c','b','d','e','a'], dict_of_neighbours) [['a','e','b','d','c','a',90], [['a','c','d','b','e','a',90],['a','d','b','c','e','a',93], ['a','c','b','e','d','a',102], ['a','c','e','d','b','a',113], ['a','b','c','d','e','a',93]] From 32349c18d16eba58c38fc7298ceb1a3ca36a3c34 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 19:23:14 +0200 Subject: [PATCH 33/36] The >>> are not doctests so change to >>) --- searches/tabu_search.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/searches/tabu_search.py b/searches/tabu_search.py index 4c9b4ba4d443..ffd84f8ac031 100644 --- a/searches/tabu_search.py +++ b/searches/tabu_search.py @@ -130,8 +130,7 @@ def find_neighborhood(solution, dict_of_neighbours): Example: - >>> dict_of_neighbours = {} - >>> find_neighborhood(['a','c','b','d','e','a'], dict_of_neighbours) + >>) find_neighborhood(['a','c','b','d','e','a']) [['a','e','b','d','c','a',90], [['a','c','d','b','e','a',90],['a','d','b','c','e','a',93], ['a','c','b','e','d','a',102], ['a','c','e','d','b','a',113], ['a','b','c','d','e','a',93]] From 5bc56344247b95a808a05beeb935f4d602d47d66 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 6 Jul 2019 19:27:04 +0200 Subject: [PATCH 34/36] Travis CI: Run black, doctest, flake8, mypy, and pytest --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6d7537be3247..e67bd431a7c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_script: - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics script: - mypy --ignore-missing-imports . - - pytest --doctest-modules ./ciphers ./other ./searches ./sorts ./strings || true + - pytest --doctest-modules ./ciphers ./other ./searches ./sorts ./strings after_success: - python ./~script.py - cat DIRECTORY.md From 976f914a20089466c0daeee426836d13ad7e06a7 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 7 Jul 2019 18:25:24 +0200 Subject: [PATCH 35/36] Link to the separate DIRECTORY.md file --- README.md | 334 +----------------------------------------------------- 1 file changed, 2 insertions(+), 332 deletions(-) diff --git a/README.md b/README.md index a609dc077a77..026e952e651c 100644 --- a/README.md +++ b/README.md @@ -28,336 +28,6 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute. We're on [Gitter](https://gitter.im/TheAlgorithms)! Please join us. -# Algorithms +## Algorithms -## Hashes - -- [Md5](./hashes/md5.py) -- [Chaos Machine](./hashes/chaos_machine.py) -- [Sha1](./hashes/sha1.py) - -## File Transfer Protocol - -- [Ftp Client Server](./file_transfer_protocol/ftp_client_server.py) -- [Ftp Send Receive](./file_transfer_protocol/ftp_send_receive.py) - -## Backtracking - -- [N Queens](./backtracking/n_queens.py) -- [Sum Of Subsets](./backtracking/sum_of_subsets.py) - -## Ciphers - -- [Transposition Cipher](./ciphers/transposition_cipher.py) -- [Atbash](./ciphers/Atbash.py) -- [Rot13](./ciphers/rot13.py) -- [Rabin Miller](./ciphers/rabin_miller.py) -- [Transposition Cipher Encrypt Decrypt File](./ciphers/transposition_cipher_encrypt_decrypt_file.py) -- [Affine Cipher](./ciphers/affine_cipher.py) -- [Trafid Cipher](./ciphers/trafid_cipher.py) -- [Base16](./ciphers/base16.py) -- [Elgamal Key Generator](./ciphers/elgamal_key_generator.py) -- [Rsa Cipher](./ciphers/rsa_cipher.py) -- [Prehistoric Men.txt](./ciphers/prehistoric_men.txt) -- [Vigenere Cipher](./ciphers/vigenere_cipher.py) -- [Xor Cipher](./ciphers/xor_cipher.py) -- [Brute Force Caesar Cipher](./ciphers/brute_force_caesar_cipher.py) -- [Rsa Key Generator](./ciphers/rsa_key_generator.py) -- [Simple Substitution Cipher](./ciphers/simple_substitution_cipher.py) -- [Playfair Cipher](./ciphers/playfair_cipher.py) -- [Morse Code Implementation](./ciphers/morse_Code_implementation.py) -- [Base32](./ciphers/base32.py) -- [Base85](./ciphers/base85.py) -- [Base64 Cipher](./ciphers/base64_cipher.py) -- [Onepad Cipher](./ciphers/onepad_cipher.py) -- [Caesar Cipher](./ciphers/caesar_cipher.py) -- [Hill Cipher](./ciphers/hill_cipher.py) -- [Cryptomath Module](./ciphers/cryptomath_module.py) - -## Arithmetic Analysis - -- [Bisection](./arithmetic_analysis/bisection.py) -- [Newton Method](./arithmetic_analysis/newton_method.py) -- [Newton Raphson Method](./arithmetic_analysis/newton_raphson_method.py) -- [Intersection](./arithmetic_analysis/intersection.py) -- [Lu Decomposition](./arithmetic_analysis/lu_decomposition.py) - -## Boolean Algebra - -- [Quine Mc Cluskey](./boolean_algebra/quine_mc_cluskey.py) - -## Traversals - -- [Binary Tree Traversals](./traversals/binary_tree_traversals.py) - -## Maths - -- [Average](./maths/average.py) -- [Abs Max](./maths/abs_Max.py) -- [Average Median](./maths/average_median.py) -- [Trapezoidal Rule](./maths/trapezoidal_rule.py) -- [Prime Check](./maths/Prime_Check.py) -- [Modular Exponential](./maths/modular_exponential.py) -- [Newton Raphson](./maths/newton_raphson.py) -- [Factorial Recursive](./maths/factorial_recursive.py) -- [Extended Euclidean Algorithm](./maths/extended_euclidean_algorithm.py) -- [Greater Common Divisor](./maths/greater_common_divisor.py) -- [Fibonacci](./maths/fibonacci.py) -- [Find Lcm](./maths/find_lcm.py) -- [Find Max](./maths/Find_Max.py) -- [Fermat Little Theorem](./maths/fermat_little_theorem.py) -- [Factorial Python](./maths/factorial_python.py) -- [Fibonacci Sequence Recursion](./maths/fibonacci_sequence_recursion.py) -- [Sieve Of Eratosthenes](./maths/sieve_of_eratosthenes.py) -- [Abs Min](./maths/abs_Min.py) -- [Lucas Series](./maths/lucasSeries.py) -- [Segmented Sieve](./maths/segmented_sieve.py) -- [Find Min](./maths/Find_Min.py) -- [Abs](./maths/abs.py) -- [Simpson Rule](./maths/simpson_rule.py) -- [Basic Maths](./maths/basic_maths.py) -- [3n+1](./maths/3n+1.py) -- [Binary Exponentiation](./maths/Binary_Exponentiation.py) - -## Digital Image Processing - -- ## Filters - - - [Median Filter](./digital_image_processing/filters/median_filter.py) - - [Gaussian Filter](./digital_image_processing/filters/gaussian_filter.py) - - -## Compression - -- [Peak Signal To Noise Ratio](./compression/peak_signal_to_noise_ratio.py) -- [Huffman](./compression/huffman.py) - -## Graphs - -- [BFS Shortest Path](./graphs/bfs_shortest_path.py) -- [Directed And Undirected (Weighted) Graph](<./graphs/Directed_and_Undirected_(Weighted)_Graph.py>) -- [Minimum Spanning Tree Prims](./graphs/minimum_spanning_tree_prims.py) -- [Graph Matrix](./graphs/graph_matrix.py) -- [Basic Graphs](./graphs/basic_graphs.py) -- [Dijkstra 2](./graphs/dijkstra_2.py) -- [Tarjans Strongly Connected Components](./graphs/tarjans_scc.py) -- [Check Bipartite Graph BFS](./graphs/check_bipartite_graph_bfs.py) -- [Depth First Search](./graphs/depth_first_search.py) -- [Kahns Algorithm Long](./graphs/kahns_algorithm_long.py) -- [Breadth First Search](./graphs/breadth_first_search.py) -- [Dijkstra](./graphs/dijkstra.py) -- [Articulation Points](./graphs/articulation_points.py) -- [Bellman Ford](./graphs/bellman_ford.py) -- [Check Bipartite Graph Dfs](./graphs/check_bipartite_graph_dfs.py) -- [Strongly Connected Components Kosaraju](./graphs/scc_kosaraju.py) -- [Multi Hueristic Astar](./graphs/multi_hueristic_astar.py) -- [Page Rank](./graphs/page_rank.py) -- [Eulerian Path And Circuit For Undirected Graph](./graphs/Eulerian_path_and_circuit_for_undirected_graph.py) -- [Edmonds Karp Multiple Source And Sink](./graphs/edmonds_karp_multiple_source_and_sink.py) -- [Floyd Warshall](./graphs/floyd_warshall.py) -- [Minimum Spanning Tree Kruskal](./graphs/minimum_spanning_tree_kruskal.py) -- [Prim](./graphs/prim.py) -- [Kahns Algorithm Topo](./graphs/kahns_algorithm_topo.py) -- [BFS](./graphs/BFS.py) -- [Finding Bridges](./graphs/finding_bridges.py) -- [Graph List](./graphs/graph_list.py) -- [Dijkstra Algorithm](./graphs/dijkstra_algorithm.py) -- [A Star](./graphs/a_star.py) -- [Even Tree](./graphs/even_tree.py) -- [DFS](./graphs/DFS.py) - -## Networking Flow - -- [Minimum Cut](./networking_flow/minimum_cut.py) -- [Ford Fulkerson](./networking_flow/ford_fulkerson.py) - -## Matrix - -- [Matrix Operation](./matrix/matrix_operation.py) -- [Searching In Sorted Matrix](./matrix/searching_in_sorted_matrix.py) -- [Spiral Print](./matrix/spiral_print.py) - -## Searches - -- [Quick Select](./searches/quick_select.py) -- [Binary Search](./searches/binary_search.py) -- [Interpolation Search](./searches/interpolation_search.py) -- [Jump Search](./searches/jump_search.py) -- [Linear Search](./searches/linear_search.py) -- [Ternary Search](./searches/ternary_search.py) -- [Tabu Search](./searches/tabu_search.py) -- [Sentinel Linear Search](./searches/sentinel_linear_search.py) - -## Conversions - -- [Decimal To Binary](./conversions/decimal_to_binary.py) -- [Decimal To Octal](./conversions/decimal_to_octal.py) - -## Dynamic Programming - -- [Fractional Knapsack](./dynamic_programming/Fractional_Knapsack.py) -- [Sum Of Subset](./dynamic_programming/sum_of_subset.py) -- [Fast Fibonacci](./dynamic_programming/fast_fibonacci.py) -- [Bitmask](./dynamic_programming/bitmask.py) -- [Abbreviation](./dynamic_programming/abbreviation.py) -- [Rod Cutting](./dynamic_programming/rod_cutting.py) -- [Knapsack](./dynamic_programming/knapsack.py) -- [Max Sub Array](./dynamic_programming/max_sub_array.py) -- [Fibonacci](./dynamic_programming/fibonacci.py) -- [Minimum Partition](./dynamic_programming/minimum_partition.py) -- [K Means Clustering Tensorflow](./dynamic_programming/k_means_clustering_tensorflow.py) -- [Coin Change](./dynamic_programming/coin_change.py) -- [Subset Generation](./dynamic_programming/subset_generation.py) -- [Floyd Warshall](./dynamic_programming/floyd_warshall.py) -- [Longest Sub Array](./dynamic_programming/longest_sub_array.py) -- [Integer Partition](./dynamic_programming/integer_partition.py) -- [Matrix Chain Order](./dynamic_programming/matrix_chain_order.py) -- [Edit Distance](./dynamic_programming/edit_distance.py) -- [Longest Common Subsequence](./dynamic_programming/longest_common_subsequence.py) -- [Longest Increasing Subsequence O(nlogn)](<./dynamic_programming/longest_increasing_subsequence_O(nlogn).py>) -- [Longest Increasing Subsequence](./dynamic_programming/longest_increasing_subsequence.py) - -## Divide And Conquer - -- [Max Subarray Sum](./divide_and_conquer/max_subarray_sum.py) -- [Max Sub Array Sum](./divide_and_conquer/max_sub_array_sum.py) -- [Closest Pair Of Points](./divide_and_conquer/closest_pair_of_points.py) - -## Strings - -- [Knuth Morris Pratt](./strings/knuth_morris_pratt.py) -- [Rabin Karp](./strings/rabin_karp.py) -- [Naive String Search](./strings/naive_String_Search.py) -- [Levenshtein Distance](./strings/levenshtein_distance.py) -- [Min Cost String Conversion](./strings/min_cost_string_conversion.py) -- [Boyer Moore Search](./strings/Boyer_Moore_Search.py) -- [Manacher](./strings/manacher.py) - -## Sorts - -- [Quick Sort](./sorts/quick_sort.py) -- [Selection Sort](./sorts/selection_sort.py) -- [Bitonic Sort](./sorts/Bitonic_Sort.py) -- [Cycle Sort](./sorts/cycle_sort.py) -- [Comb Sort](./sorts/comb_sort.py) -- [Topological Sort](./sorts/topological_sort.py) -- [Merge Sort Fastest](./sorts/merge_sort_fastest.py) -- [Random Pivot Quick Sort](./sorts/random_pivot_quick_sort.py) -- [Heap Sort](./sorts/heap_sort.py) -- [Insertion Sort](./sorts/insertion_sort.py) -- [Counting Sort](./sorts/counting_sort.py) -- [Bucket Sort](./sorts/bucket_sort.py) -- [Quick Sort 3 Partition](./sorts/quick_sort_3_partition.py) -- [Bogo Sort](./sorts/bogo_sort.py) -- [Shell Sort](./sorts/shell_sort.py) -- [Pigeon Sort](./sorts/pigeon_sort.py) -- [Odd-Even Transposition Parallel](./sorts/Odd-Even_transposition_parallel.py) -- [Tree Sort](./sorts/tree_sort.py) -- [Cocktail Shaker Sort](./sorts/cocktail_shaker_sort.py) -- [Random Normal Distribution Quicksort](./sorts/random_normal_distribution_quicksort.py) -- [Wiggle Sort](./sorts/wiggle_sort.py) -- [Pancake Sort](./sorts/pancake_sort.py) -- [External Sort](./sorts/external_sort.py) -- [Tim Sort](./sorts/tim_sort.py) -- [Sorting Graphs.png](./sorts/sorting_graphs.png) -- [Radix Sort](./sorts/radix_sort.py) -- [Odd-Even Transposition Single-threaded](./sorts/Odd-Even_transposition_single-threaded.py) -- [Bubble Sort](./sorts/bubble_sort.py) -- [Gnome Sort](./sorts/gnome_sort.py) -- [Merge Sort](./sorts/merge_sort.py) - -## Machine Learning - -- [Perceptron](./machine_learning/perceptron.py) -- [Random Forest Classifier](./machine_learning/random_forest_classification/random_forest_classifier.ipynb) -- [NaiveBayes.ipynb](./machine_learning/NaiveBayes.ipynb) -- [Scoring Functions](./machine_learning/scoring_functions.py) -- [Logistic Regression](./machine_learning/logistic_regression.py) -- [Gradient Descent](./machine_learning/gradient_descent.py) -- [Linear Regression](./machine_learning/linear_regression.py) -- [Random Forest Regression](./machine_learning/random_forest_regression/random_forest_regression.py) -- [Random Forest Regression](./machine_learning/random_forest_regression/random_forest_regression.ipynb) -- [Reuters One Vs Rest Classifier.ipynb](./machine_learning/reuters_one_vs_rest_classifier.ipynb) -- [Decision Tree](./machine_learning/decision_tree.py) -- [Knn Sklearn](./machine_learning/knn_sklearn.py) -- [K Means Clust](./machine_learning/k_means_clust.py) - -## Neural Network - -- [Perceptron](./neural_network/perceptron.py) -- [Fully Connected Neural Network](./neural_network/fully_connected_neural_network.ipynb) -- [Convolution Neural Network](./neural_network/convolution_neural_network.py) -- [Back Propagation Neural Network](./neural_network/back_propagation_neural_network.py) - -## Data Structures - -- ## Binary Tree - - - [Basic Binary Tree](./data_structures/binary_tree/basic_binary_tree.py) - - [Red Black Tree](./data_structures/binary_tree/red_black_tree.py) - - [Fenwick Tree](./data_structures/binary_tree/fenwick_tree.py) - - [Treap](./data_structures/binary_tree/treap.py) - - [AVL Tree](./data_structures/binary_tree/AVL_tree.py) - - [Segment Tree](./data_structures/binary_tree/segment_tree.py) - - [Lazy Segment Tree](./data_structures/binary_tree/lazy_segment_tree.py) - - [Binary Search Tree](./data_structures/binary_tree/binary_search_tree.py) - -- ## Trie - - - [Trie](./data_structures/trie/trie.py) - -- ## Linked List - - - [Swap Nodes](./data_structures/linked_list/swap_nodes.py) - - [Doubly Linked List](./data_structures/linked_list/doubly_linked_list.py) - - [Singly Linked List](./data_structures/linked_list/singly_linked_list.py) - - [Is Palindrome](./data_structures/linked_list/is_Palindrome.py) - -- ## Stacks - - - [Postfix Evaluation](./data_structures/stacks/postfix_evaluation.py) - - [Balanced Parentheses](./data_structures/stacks/balanced_parentheses.py) - - [Infix To Prefix Conversion](./data_structures/stacks/infix_to_prefix_conversion.py) - - [Stack](./data_structures/stacks/stack.py) - - [Infix To Postfix Conversion](./data_structures/stacks/infix_to_postfix_conversion.py) - - [Next Greater Element](./data_structures/stacks/next_greater_element.py) - - [Stock Span Problem](./data_structures/stacks/stock_span_problem.py) - -- ## Queue - - - [Queue On Pseudo Stack](./data_structures/queue/queue_on_pseudo_stack.py) - - [Double Ended Queue](./data_structures/queue/double_ended_queue.py) - - [Queue On List](./data_structures/queue/queue_on_list.py) - -- ## Heap - - - [Heap](./data_structures/heap/heap.py) - -- ## Hashing - - - [Hash Table With Linked List](./data_structures/hashing/hash_table_with_linked_list.py) - - [Quadratic Probing](./data_structures/hashing/quadratic_probing.py) - - [Hash Table](./data_structures/hashing/hash_table.py) - - [Double Hash](./data_structures/hashing/double_hash.py) - - -## Other - -- [Detecting English Programmatically](./other/detecting_english_programmatically.py) -- [Fischer Yates Shuffle](./other/fischer_yates_shuffle.py) -- [Primelib](./other/primelib.py) -- [Binary Exponentiation 2](./other/binary_exponentiation_2.py) -- [Anagrams](./other/anagrams.py) -- [Palindrome](./other/palindrome.py) -- [Finding Primes](./other/finding_Primes.py) -- [Two Sum](./other/two_sum.py) -- [Password Generator](./other/password_generator.py) -- [Linear Congruential Generator](./other/linear_congruential_generator.py) -- [Frequency Finder](./other/frequency_finder.py) -- [Euclidean Gcd](./other/euclidean_gcd.py) -- [Word Patterns](./other/word_patterns.py) -- [Nested Brackets](./other/nested_brackets.py) -- [Binary Exponentiation](./other/binary_exponentiation.py) -- [Sierpinski Triangle](./other/sierpinski_triangle.py) -- [Game Of Life](./other/game_of_life.py) -- [Tower Of Hanoi](./other/tower_of_hanoi.py) +See our [DIRECTORY.md](DIRECTORY.md) file. From fab6bc2cd28f4b2dedeae84354163cb73618f217 Mon Sep 17 00:00:00 2001 From: John Law Date: Mon, 8 Jul 2019 23:20:59 +0800 Subject: [PATCH 36/36] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4cc65e083004..30eccd361673 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ These implementations are for learning purposes. They may be less efficient than Anup Kumar Panwar   [[Gmail](mailto:1anuppanwar@gmail.com?Subject=The%20Algorithms%20-%20Python) -  [Gihub](https://github.com/anupkumarpanwar) +  [GitHub](https://github.com/anupkumarpanwar)   [LinkedIn](https://www.linkedin.com/in/anupkumarpanwar/)] Chetan Kaushik   [[Gmail](mailto:dynamitechetan@gmail.com?Subject=The%20Algorithms%20-%20Python) -  [Gihub](https://github.com/dynamitechetan) +  [GitHub](https://github.com/dynamitechetan)   [LinkedIn](https://www.linkedin.com/in/chetankaushik/)] ## Contribution Guidelines @@ -30,4 +30,4 @@ We're on [Gitter](https://gitter.im/TheAlgorithms)! Please join us. ## Algorithms -See our [DIRECTORY.md](DIRECTORY.md) file. \ No newline at end of file +See our [directory](DIRECTORY.md).