Skip to content

Instantly share code, notes, and snippets.

@tamizhgeek
Created November 17, 2014 14:51
Show Gist options
  • Save tamizhgeek/827ffaaf3e6856ec6bad to your computer and use it in GitHub Desktop.
Save tamizhgeek/827ffaaf3e6856ec6bad to your computer and use it in GitHub Desktop.
import assignments.Lattice
import org.scalatest.{FlatSpec, ShouldMatchers}
class LatticePathFinderTest extends FlatSpec with ShouldMatchers{
it should "find the lattice path correctly using memoization" in {
new Lattice(2).findNoOfPathsTrivialWay shouldBe 6
new Lattice(4).findNoOfPathsTrivialWay shouldBe 56
//new Lattice(20).findNoOfPathsTrivialWay shouldBe BigInt(2311801440)
}
it should "find the lattice path correctly using pascals method" in {
new Lattice(2).findNoOfPathsPascalsWay shouldBe 6
new Lattice(4).findNoOfPathsPascalsWay shouldBe 56
//new Lattice(20).findNoOfPathsPascalsWay shouldBe BigInt(2311801440)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment