Min Max Priority Queue for Scala

287 Views Asked by At

I am searching a library with a MaxMinPriorityQueue like guava's one. As I can't use it because sbt fails when I add the dependency like this:

"com.google.guava" %% "guava" % "24.0-jre"

Its seems there is no build for scala, as it can be found:

com.google.guava:guava_2.11:24.0-jre: not found.

After searching for a while I found no similar Data Structure for Scala. Does someone knows of any implementation for a MinMaxPriorityQueue for scala?

Thanks.

2

There are 2 best solutions below

1
Knows Not Much On BEST ANSWER

This works

"com.google.guava" % "guava" % "24.0-jre"

Its written in java. so it doesn't need a scala version. thus you don't need to specify '%%' in the dependency.

0
Andrey Tyukin On

The double percent sign %% adds the "_2.11" suffix to the "guava" identifier. Since "guava" is just a Java library, it doesn't know anything about Scala at all, and it certainly does not have any versions packaged specifically for Scala 2.11.

Just copy the library dependency directly from Maven Central, as it is:

libraryDependencies += "com.google.guava" % "guava" % "24.0-jre"

(note the single %), it should work then.