Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def quicksort(matrix):
- for i in range(0, len(matrix)):
- for j in range(i, len(matrix)):
- if matrix[i] > matrix[j]:
- # Swap syntax in Java
- matrix[i], matrix[j] = matrix[j], matrix[i]
- return matrix
- # MAIN FUNCTION
- matrixA = [1, 3, 4, 10, 7, 2, 9, 8, 5, 6]
- print(quicksort(matrixA))
- matrixB = [1, 3, 4, 10, 7, 2, 9, 8, 2, 8, 5, 6]
- print(quicksort(matrixB))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement