It is easy to sort a Map by keys or values in Python (this question for example).
I would like to do the same thing in Scala, lets say I have a dictionary like:
val A= Map(0 -> 1.0, 3 -> 5.0,2->7.0)
I would like to get a List of tuples that correspond to the sorted Map by keys:
val A_sorted= List((0,1.0),(2,7.0),(3,5.0))
Thanks!