We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5418241 commit 7945b36Copy full SHA for 7945b36
src/scala/BinarySearch.scala
@@ -1,6 +1,7 @@
1
import scala.annotation.tailrec
2
3
def binarySearch(data: Seq[Int], target: Int): Option[Int] = {
4
+
5
@tailrec
6
def search(left: Int, right: Int): Option[Int] = {
7
if (left > right) None
0 commit comments