Created
November 17, 2015 12:39
-
-
Save fitomad/ed21f44fffc147b680bf 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
let fixed_array: [Int] = [ 2, 1, 4, 3, 6, 5, 8, 7, 10, 9] | |
var mutable_array: [Int] = [ 2, 8, 10, 3, 6, 5, 4, 7, 1, 9] | |
let new_fixed_array = fixed_array.sort() | |
mutable_array.sortInPlace() | |
print("> mutable: \(mutable_array.descriptionWithSeparator(", "))") | |
print("> fixed: \(fixed_array.descriptionWithSeparator(", "))") | |
print("> new fixed: \(new_fixed_array.descriptionWithSeparator(", "))") | |
// En la consola de depuración veremos... | |
// > mutable: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 | |
// > fixed: 2, 1, 4, 3, 6, 5, 8, 7, 10, 9 | |
// > new fixed: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment