From 382be93a0d8af7839a2d0c443c088f579f5b857e Mon Sep 17 00:00:00 2001 From: Nithin KS Date: Sat, 17 Oct 2020 19:55:20 +0530 Subject: [PATCH 1/6] created a folder for sorting technoque and it's readme file --- bubbleSort.py => BubbleSort/bubbleSort.py | 0 bubblesort.md => BubbleSort/bubblesort.md | 0 Bucket Sort.md => BucketSort/Bucket Sort.md | 0 bucket_sort.py => BucketSort/bucket_sort.py | 0 Heapsort.md => HeapSort/Heapsort.md | 0 Heapsort.py => HeapSort/Heapsort.py | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename bubbleSort.py => BubbleSort/bubbleSort.py (100%) rename bubblesort.md => BubbleSort/bubblesort.md (100%) rename Bucket Sort.md => BucketSort/Bucket Sort.md (100%) rename bucket_sort.py => BucketSort/bucket_sort.py (100%) rename Heapsort.md => HeapSort/Heapsort.md (100%) rename Heapsort.py => HeapSort/Heapsort.py (100%) diff --git a/bubbleSort.py b/BubbleSort/bubbleSort.py similarity index 100% rename from bubbleSort.py rename to BubbleSort/bubbleSort.py diff --git a/bubblesort.md b/BubbleSort/bubblesort.md similarity index 100% rename from bubblesort.md rename to BubbleSort/bubblesort.md diff --git a/Bucket Sort.md b/BucketSort/Bucket Sort.md similarity index 100% rename from Bucket Sort.md rename to BucketSort/Bucket Sort.md diff --git a/bucket_sort.py b/BucketSort/bucket_sort.py similarity index 100% rename from bucket_sort.py rename to BucketSort/bucket_sort.py diff --git a/Heapsort.md b/HeapSort/Heapsort.md similarity index 100% rename from Heapsort.md rename to HeapSort/Heapsort.md diff --git a/Heapsort.py b/HeapSort/Heapsort.py similarity index 100% rename from Heapsort.py rename to HeapSort/Heapsort.py From 8983d51e62c6f872d7f298605c8f1f3387e11272 Mon Sep 17 00:00:00 2001 From: Nithin KS Date: Sat, 17 Oct 2020 19:56:34 +0530 Subject: [PATCH 2/6] adding sleep sort --- SleepSort/sleepSort.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 SleepSort/sleepSort.py diff --git a/SleepSort/sleepSort.py b/SleepSort/sleepSort.py new file mode 100644 index 0000000..25f1352 --- /dev/null +++ b/SleepSort/sleepSort.py @@ -0,0 +1,11 @@ +import threading +import time + +def sort(num): + time.sleep(num) + print(num, end = ' ') + +to_sort = [9,8,7,6,5,4,3,2,1,0] +for x in to_sort: + t = threading.Thread(target=sort, args=(x,)) + t.start() \ No newline at end of file From 9a516b6b9718db2bb9afc1da5d0485de8b9c419a Mon Sep 17 00:00:00 2001 From: Nithin KS Date: Sat, 17 Oct 2020 20:10:24 +0530 Subject: [PATCH 3/6] Create sleepSort.md --- SleepSort/sleepSort.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 SleepSort/sleepSort.md diff --git a/SleepSort/sleepSort.md b/SleepSort/sleepSort.md new file mode 100644 index 0000000..73b3626 --- /dev/null +++ b/SleepSort/sleepSort.md @@ -0,0 +1,10 @@ +Sleep sort is a sorting algorithm where +* a thread are created for every element in the unsorted list +* put the thread on sleep for a certian amount of time i.e., if the element is 2, make the thread sleep for 2 units. +* print the element or store the elment. + +So basically, larger the value longer sleep period for the thread, smaller the value less sleep period for the thread +which leads the program to sort the given array. + +Source +[StackExchange](https://softwareengineering.stackexchange.com/a/106356) From 2e8c7dcfbca6e09b7c23a77c0ccc2c8703c689ce Mon Sep 17 00:00:00 2001 From: Nithin KS Date: Sat, 17 Oct 2020 20:11:22 +0530 Subject: [PATCH 4/6] Update README.md add sleep sort to the list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 69cadbe..d958548 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ - [Heap Sort](https://github.com/blackeye735/Sorting-Algorithms-in-Python/blob/master/Heapsort.py) - [Bucket Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/bucket_sort.py) - [Tree Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/tree_sort.py) +- Sleep Sort ## Proposed List of Sorting Algos: From f69ca39c1f2710b7ebb4877d02523cd79b329db9 Mon Sep 17 00:00:00 2001 From: Nithin KS Date: Sat, 17 Oct 2020 20:17:58 +0530 Subject: [PATCH 5/6] link list with their files changing hyperlinks with the path in the repository for the files. --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d958548..e9656b6 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,16 @@ - Please use 3.x python only. ## Current List of Sorting Algos: -- [Quick Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/QuickSort.py) -- [Selection Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/Selection_Sort.py) -- [Insertion Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/insertion_sort.py) -- [Merge Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/merge_sort.py) -- [Bubble Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/bubbleSort.py) -- [Counting Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/counting_sort.py) -- [Heap Sort](https://github.com/blackeye735/Sorting-Algorithms-in-Python/blob/master/Heapsort.py) -- [Bucket Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/bucket_sort.py) -- [Tree Sort](https://github.com/Zircoz/Sorting-Algorithms-in-Python/blob/master/tree_sort.py) -- Sleep Sort +- [Quick Sort](QuickSort.py) +- [Selection Sort](Selection_Sort.py) +- [Insertion Sort](insertion_sort.py) +- [Merge Sort](merge_sort.py) +- [Bubble Sort](BubbleSort/bubbleSort.py) +- [Counting Sort](counting_sort.py) +- [Heap Sort](HeapSort/Heapsort.py) +- [Bucket Sort](BucketSort/bucket_sort.py) +- [Tree Sort](tree_sort.py) +- [Sleep Sort](SleepSort/sleepSort.py) ## Proposed List of Sorting Algos: From ae871e3b14ac86f9dcd2a2d9eba23f2d1c97320e Mon Sep 17 00:00:00 2001 From: Nithin KS <50230678+nithinkodadhavadee@users.noreply.github.com> Date: Mon, 14 Jun 2021 17:30:05 +0530 Subject: [PATCH 6/6] rename SleepSort\sleepSort.py to SleepSort\README.md --- SleepSort/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 SleepSort/README.md diff --git a/SleepSort/README.md b/SleepSort/README.md new file mode 100644 index 0000000..73b3626 --- /dev/null +++ b/SleepSort/README.md @@ -0,0 +1,10 @@ +Sleep sort is a sorting algorithm where +* a thread are created for every element in the unsorted list +* put the thread on sleep for a certian amount of time i.e., if the element is 2, make the thread sleep for 2 units. +* print the element or store the elment. + +So basically, larger the value longer sleep period for the thread, smaller the value less sleep period for the thread +which leads the program to sort the given array. + +Source +[StackExchange](https://softwareengineering.stackexchange.com/a/106356)