Tag: Basics

This is coding algorithm – Scala code bubble sort for loop

object Sort{ def bubbleSort () : Unit = { var myArray = Array(4, 7, 8, 3, 1, 9, 2, 5, 0, 6) var buf:Int = 0; for(i <- 0 to (myArray.length-1)) { for (j <- 1 to (myArray.length)){ if (myArray(j) < myArray(j-1)){ buf = myArray(j) myArray(j) = myArray(j-1) myArray(j-1) = buf } } } println("SORTED") … Continue reading This is coding algorithm – Scala code bubble sort for loop

Advertisements

install Scala version 2.12.4 news

The most popular way to get Scala is either using Scala through sbt, the Scala build tool, or to use Scala through an IDE. 1 First, make sure you have the Java 8 JDK installed. To check, open the terminal and type: java -version(Make sure you have version 1.8.) (If you don't have it installed, download … Continue reading install Scala version 2.12.4 news