
com.mle.util.Lists.scala Maven / Gradle / Ivy
The newest version!
package com.mle.util
/**
*
* @author mle
*/
object Lists {
def interleave[T](left: List[T], right: List[T]): List[T] =
if (left.isEmpty) right
else if (right.isEmpty) left
else left.head :: right.head :: interleave(left.tail, right.tail)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy