Skip to content
View Ackermann.scala
Ackermann is being studied for recursion. It is quite complex to do TCO for Ackermann.
However, there have been some implementation of Ackermann in Haskell with TCO
object Ackermann {
def main(args : Array[String]) : Unit = {
View RecursionEx.scala
This is the recursion example (p.97) used in "Programming Interviews Exposed"
by John Mongan, Noah Suojanen, Eric Giguère
The book's imperative style C# code (function combine) has been reimplemented in Scala.
Function recursionEx is in pure FP way.
Function tailReccursionEx is implemented to get TCO'ed (TCO=Tail Call Optimization)
Here is the problem statement:
View Telephone Words
This is the FP implementation of the "Telephone Words"
where the program accept 7 digit ph number and spit out
all possible word combination e.g. 464-7328 can be
Per following table, where 1 and 0 does not represent any alphabet
View boyer_moore.scala
object boyer_more {
def main(args : Array[String]) = {
if (args.length == 2 && args(0).length >= args(1).length) {
val result = boyer_more_search(args(0), args(1))
println("Match found : " + result.length +
" Pos : " + result.mkString(" "))
} else {
println("Usage: boyer_more string_body search_string")
View TicTacToe.scala
import io.Source
import scala.util.control.Breaks._
* Scala TicTacToe game without any side effects
object TicTacToe {
val WinCount = 3
Something went wrong with that request. Please try again.