Skip to content

Instantly share code, notes, and snippets.

@andr83
Created February 17, 2017 09:38
Show Gist options
  • Save andr83/f13478a9f132c51b7bd240dd86c147be to your computer and use it in GitHub Desktop.
Save andr83/f13478a9f132c51b7bd240dd86c147be to your computer and use it in GitHub Desktop.
case class T(x: Int, y: Int)
val tOrdering = Ordering.fromLessThan[T](_.x > _.x)
var tree = scala.collection.immutable.TreeSet.empty(tOrdering)
tree = tree + T(10,2)
tree = tree + T(1,2)
tree = tree + T(1,3)
tree = tree + T(5,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment