I'm attempting to convert a Selection sort from Java to Scala and im unsure how to convert this loop to Scala :
for (int j = i + 1; j < N; j++)
Here is a larger Java code sample and its Scala equivalent :
Java :
sort(Comparable[] a)
{
int N = a.length;
for (int i = 0; i < N; i++)
{
int min = i
for (int j = i + 1; j < N; j++)
}
Scala :
def sort(a : Array[Ordered[Any]]) = {
var N = a.length
for (i <- 0 until N) {
var min = i
for(j <- until j < N){
}
}
}
How do I convert the inner loop to Scala ?
for (int j = i + 1; j < N; j++)
I dont know how to do assignment while iterating...