Created
June 7, 2023 20:02
-
-
Save IslamRustamov/a77f6a1375733cfd7d8ce66f67c1b73e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func sort(result: FlutterResult, _ array: [Int]) { | |
var arr = array | |
for _ in 0...arr.count { | |
for value in 1...arr.count - 1 { | |
if arr[value-1] > arr[value] { | |
let largerValue = arr[value-1] | |
arr[value-1] = arr[value] | |
arr[value] = largerValue | |
} | |
} | |
} | |
result(arr) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment