Skip to content

Instantly share code, notes, and snippets.

@maiha
Created November 14, 2014 07:17
Show Gist options
  • Save maiha/1375623c9aa26bb4f0ce to your computer and use it in GitHub Desktop.
Save maiha/1375623c9aa26bb4f0ce to your computer and use it in GitHub Desktop.
OrderedMap in scala
scala> collection.immutable.ListMap(5->"",4->"",3->"",2->"",10->"",1->"") foreach(println)
(5,)
(4,)
(3,)
(2,)
(10,)
(1,)
scala> collection.immutable.TreeMap(5->"",4->"",3->"",2->"",10->"",1->"") foreach(println)
(1,)
(2,)
(3,)
(4,)
(5,)
(10,)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment