Sortierung der Dateien und Databases

This commit is contained in:
Panckiko11
2026-09-28 20:34:10 +02:00
parent 32d3f1ba5d
commit 3119fb4fc8
9 changed files with 28 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import numpy as np
import time
start = time.time()
random_arr = np.random.randint(1,2001,2000)
print(random_arr)
sorted = False
while sorted == False:
sorted = True
for index in range(len(random_arr) - 1):
if random_arr[index] > random_arr[index + 1]:
temp = random_arr[index]
random_arr[index] = random_arr[index + 1]
random_arr[index + 1] = temp
sorted = False
end = time.time()
total_time = end - start
print(random_arr)
print(f'total time:{total_time} s')