Commit cb829410 by BellCodeEditor

save project

parent bb5623b9
Showing with 16 additions and 7 deletions
alist = [88, 75, 72, 82, 90, 85, 78, 91]
import random
import time
time1=time.time()
alist = []
for i in range(10000):
alist.append(random.randint(1,1000000000000000000000000000000000000000000000000000000000000000000000000000000000000))
n=len(alist)
for i in range(n-1):
for j in range(0,n-1):
if alist[j] > alist[j+1]:
alist[j],alist[j+1]=alist[j+1],alist[j]
print(alist)
\ No newline at end of file
def px(list):
for i in range(n-1):
for j in range(0,n-1):
if list[j] > list[j+1]:
list[j],list[j+1]=list[j+1],list[j]
print(list)
px(alist)
time2=time.time()
print(time2-time1)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment