Add files via upload

This commit is contained in:
Mateusz779 2021-12-15 19:32:55 +01:00 committed by GitHub
parent 2b91028671
commit 4f57198ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,43 @@
def sort_func(sort=[],repeat=False):
global size_array
size_array = 0
t = True
j = 0
le=len(sort)-1
while (t):
for i in range(0,le-1):
if sort[i] > sort[i + 1]:
tmp1 = sort[i];
sort[i] = sort[i + 1];
sort[i + 1] = tmp1;
j = 0;
elif sort[i] == sort[i + 1] and repeat==False:
del sort[i]
size_array=size_array-1
le=le-1
j = 0;
else:
if (j == le):
t = False
else:
j=j+1;
return sort
def main():
temp=[2,7,2,1,3,100,3,32,342,2,44,23]
sorted=sort_func(temp,False)
for i in sorted:
print(i)
if __name__ == '__main__':
main()