Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Sort-stability/Groovy/sort-stability.groovy
Normal file
10
Task/Sort-stability/Groovy/sort-stability.groovy
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
def cityList = ['UK London', 'US New York', 'US Birmingham', 'UK Birmingham',].asImmutable()
|
||||
[
|
||||
'Sort by city': { city -> city[4..-1] },
|
||||
'Sort by country': { city -> city[0..3] },
|
||||
].each{ String label, Closure orderBy ->
|
||||
println "\n\nBefore ${label}"
|
||||
cityList.each { println it }
|
||||
println "\nAfter ${label}"
|
||||
cityList.sort(false, orderBy).each{ println it }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue