Skip to content

Commit 42f63cc

Browse files
Created my own sorting algorithm =)
1 parent c0b5085 commit 42f63cc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Algorithms/sorting/hopesort.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'''
2+
Hopesort algorithm. If it works, then it works in constant time.
3+
Use at own risk :)
4+
5+
Programmed by Aladdin Persson <aladdin.persson at hotmail dot com>
6+
* 2019-03-08 Initial code
7+
8+
'''
9+
10+
def hopesort(L):
11+
# hope it is sorted
12+
return L
13+
14+
if __name__ == '__main__':
15+
unsorted = [1,2,3,4,5,6]
16+
# constant time
17+
hopefully_sorted = hopesort(unsorted)
18+
print(hopefully_sorted)

0 commit comments

Comments
 (0)