From 7735a3d06ecf7dfe63b466a115fe0c680009915b Mon Sep 17 00:00:00 2001 From: gargeesuresh <43488783+gargeesuresh@users.noreply.github.com> Date: Sat, 27 Oct 2018 23:07:43 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cda093b..6375b1b 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ Go ahead and add a one line intro about you and add your favorite emoji (you can - Hi, my name is Brandon and my favorite emoji is 🍔 +-Hi, my name is Gargee and here's my favourite emoji 🤪 + ## Conclusion Thank you for the overwhelming amount of contributions! I hope that everybody made their 4 pull requests for Hacktoberfest, and that your journey to open source doesn't end here. I am *slowly* getting through the pull requests. Check back if you don't see your changes in this repo! Best of luck :) From f5cc07dad4c811418861928971010e1e43a67cbf Mon Sep 17 00:00:00 2001 From: gargeesuresh <43488783+gargeesuresh@users.noreply.github.com> Date: Sat, 27 Oct 2018 23:12:21 +0530 Subject: [PATCH 2/2] Update tests.py --- tests.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests.py b/tests.py index 270c350..7457fa6 100644 --- a/tests.py +++ b/tests.py @@ -51,7 +51,31 @@ from bucket import bucket if(bucket(list(nums)) == sortedNums): print "Bucket Sort success" + else: print "Bucket Sort incorrect" except: print "Bucketsort function errored or is incomplete" + def selection_sort(input_list): + + for idx in range(len(input_list)): + + min_idx = idx + for j in range( idx +1, len(input_list)): + if input_list[min_idx] > input_list[j]: + min_idx = j +# Swap the minimum value with the compared value + + input_list[idx], input_list[min_idx] = input_list[min_idx], input_list[idx] + + +l = [19,2,31,45,30,11,121,27] +selection_sort(l) +print(l) +try: + if(selection_sort(list(nums)) == sortedNums): + print "selection sort success!" + else: + print "selection sort incorrect." +except: + print "selection sort function errored or is incomplete."