#!/usr/bin/ruby
#
## https://rosettacode.org/wiki/Sort_stability
#
var table = [
<UK London>,
<US New\ York>,
<US Birmingham>,
<UK Birmingham>,
];
table.sort {|a,b| a[0] <=> b[0]}.each { |col|
say "#{col[0]} #{col[1]}"
}
#!/usr/bin/ruby
#
## https://rosettacode.org/wiki/Sort_stability
#
var table = [
<UK London>,
<US New\ York>,
<US Birmingham>,
<UK Birmingham>,
];
table.sort {|a,b| a[0] <=> b[0]}.each { |col|
say "#{col[0]} #{col[1]}"
}