From 5fc4641c8cbe82d122409771b2518ada27afecc5 Mon Sep 17 00:00:00 2001 From: Christian Bender Date: Sat, 23 Feb 2019 18:58:07 +0100 Subject: [PATCH 1/2] fixed test runner --- .../sorting/{pigeonhole_sort.py => pidgeonhole_sort.py} | 2 +- tests/test_sorting.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename allalgorithms/sorting/{pigeonhole_sort.py => pidgeonhole_sort.py} (94%) diff --git a/allalgorithms/sorting/pigeonhole_sort.py b/allalgorithms/sorting/pidgeonhole_sort.py similarity index 94% rename from allalgorithms/sorting/pigeonhole_sort.py rename to allalgorithms/sorting/pidgeonhole_sort.py index c7ce64f..47cfeb1 100644 --- a/allalgorithms/sorting/pigeonhole_sort.py +++ b/allalgorithms/sorting/pidgeonhole_sort.py @@ -7,7 +7,7 @@ # Github: @martmists # -def pigeonhole_sort(data): +def pidgeonhole_sort(data): minimum = min(data) size = max(data) - minimum + 1 holes = [0] * size diff --git a/tests/test_sorting.py b/tests/test_sorting.py index 127f341..c1c41da 100644 --- a/tests/test_sorting.py +++ b/tests/test_sorting.py @@ -5,7 +5,7 @@ insertion_sort, merge_sort, selection_sort, - pigeonhole_sort, + pidgeonhole_sort, stooge_sort, cocktail_shaker_sort, tree_sort @@ -26,7 +26,7 @@ def test_selection_sort(self): self.assertEqual([-44, 1, 2, 3, 7, 19], selection_sort([7, 3, 2, 19, -44, 1])) def test_pigeonhole_sort(self): - self.assertEqual([-44, 1, 2, 3, 7, 19], pigeonhole_sort([7, 3, 2, 19, -44, 1])) + self.assertEqual([-44, 1, 2, 3, 7, 19], pidgeonhole_sort([7, 3, 2, 19, -44, 1])) def test_stooge_sort(self): self.assertEqual([-44, 1, 2, 3, 7, 19], stooge_sort([7, 3, 2, 19, -44, 1])) From 551774ec8fa0c5dff80b9fd3a51fe157c19fae9e Mon Sep 17 00:00:00 2001 From: Christian Bender Date: Sat, 23 Feb 2019 19:20:02 +0100 Subject: [PATCH 2/2] correct name again --- allalgorithms/sorting/__init__.py | 2 +- .../sorting/{pidgeonhole_sort.py => pigeonhole_sort.py} | 2 +- tests/test_sorting.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename allalgorithms/sorting/{pidgeonhole_sort.py => pigeonhole_sort.py} (94%) diff --git a/allalgorithms/sorting/__init__.py b/allalgorithms/sorting/__init__.py index 3c45246..17da872 100644 --- a/allalgorithms/sorting/__init__.py +++ b/allalgorithms/sorting/__init__.py @@ -2,7 +2,7 @@ from .insertion_sort import insertion_sort from .selection_sort import selection_sort from .bubble_sort import bubble_sort -from .pidgeonhole_sort import pidgeonhole_sort +from .pigeonhole_sort import pigeonhole_sort from .stooge_sort import stooge_sort from .cocktail_shaker_sort import cocktail_shaker_sort from .tree_sort import tree_sort diff --git a/allalgorithms/sorting/pidgeonhole_sort.py b/allalgorithms/sorting/pigeonhole_sort.py similarity index 94% rename from allalgorithms/sorting/pidgeonhole_sort.py rename to allalgorithms/sorting/pigeonhole_sort.py index 47cfeb1..c7ce64f 100644 --- a/allalgorithms/sorting/pidgeonhole_sort.py +++ b/allalgorithms/sorting/pigeonhole_sort.py @@ -7,7 +7,7 @@ # Github: @martmists # -def pidgeonhole_sort(data): +def pigeonhole_sort(data): minimum = min(data) size = max(data) - minimum + 1 holes = [0] * size diff --git a/tests/test_sorting.py b/tests/test_sorting.py index c1c41da..127f341 100644 --- a/tests/test_sorting.py +++ b/tests/test_sorting.py @@ -5,7 +5,7 @@ insertion_sort, merge_sort, selection_sort, - pidgeonhole_sort, + pigeonhole_sort, stooge_sort, cocktail_shaker_sort, tree_sort @@ -26,7 +26,7 @@ def test_selection_sort(self): self.assertEqual([-44, 1, 2, 3, 7, 19], selection_sort([7, 3, 2, 19, -44, 1])) def test_pigeonhole_sort(self): - self.assertEqual([-44, 1, 2, 3, 7, 19], pidgeonhole_sort([7, 3, 2, 19, -44, 1])) + self.assertEqual([-44, 1, 2, 3, 7, 19], pigeonhole_sort([7, 3, 2, 19, -44, 1])) def test_stooge_sort(self): self.assertEqual([-44, 1, 2, 3, 7, 19], stooge_sort([7, 3, 2, 19, -44, 1])) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy