Scala Implementation of Shell Sort