Last active
July 7, 2024 23:34
-
-
Save espio999/4bb03a54fc59a4733851225973fe0fc7 to your computer and use it in GitHub Desktop.
F# fibonacci, call memo.fsx and fibonacci.fsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load "memo.fsx" | |
#load "fibonacci.fsx" | |
open memo | |
open fibonacci | |
open System.Diagnostics | |
let memo_fib = memoize fib | |
let memo_fib_tail = memoize fib_tail_recursion | |
//let sw = new System.Diagnostics.Stopwatch() | |
let sw = new Stopwatch() | |
sw.Start() | |
memo_fib 45 |> printfn "%A" | |
sw.Stop() | |
sw.ToString() |> printfn "%s" | |
sw.Restart() | |
memo_fib_tail 45 |> printfn "%A" | |
sw.Stop() | |
sw.ToString() |> printfn "%s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment