Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- N = 1000
- list1 = []
- for i in range(0, N):
- list1.append(random.randint(0, N-1))
- list2 = list(list1)
- print '\nRandom Integer String:\n\n', list2
- # Selection Sort
- for i in range(0, len (list2)):
- min = i
- for j in range(i + 1, len(list2)):
- if list2[j] < list2[min]:
- min = j
- list2[i], list2[min] = list2[min], list2[i]
- print '\n\nSorted Integer String:\n\n', list2
Advertisement
Add Comment
Please, Sign In to add comment