Skip to content

Commit 0cc46f2

Browse files
committed
updated to user driven
1 parent ce4670d commit 0cc46f2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

python/sorting/bogo-sort.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ def shuffle(a):
2727
a[i], a[r] = a[r], a[i]
2828

2929
# Driver code to test above
30-
a = [3, 2, 4, 1, 0, 5]
30+
a = []
31+
n = int(input("Enter no of elements:"))
32+
for i in range(0,n):
33+
element = int(input())
34+
a.append(element)
35+
36+
3137
bogoSort(a)
3238
print("Sorted array :")
3339
for i in range(len(a)):

0 commit comments

Comments
 (0)