diff options
Diffstat (limited to 'PerformaceTester.sol')
-rw-r--r-- | PerformaceTester.sol | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/PerformaceTester.sol b/PerformaceTester.sol new file mode 100644 index 00000000..3b1202ce --- /dev/null +++ b/PerformaceTester.sol @@ -0,0 +1,17 @@ +contract PerformanceTester { + function ackermann(uint m, uint n) returns (uint) { + if (m == 0) + return n + 1; + + if (n == 0) + return ackermann(m - 1, 1); + + return ackermann(m - 1, ackermann(m, n - 1)); + } + + function fibonacci(uint n) returns (uint) { + if (n == 0 || n == 1) + return n; + return fibonacci(n - 1) + fibonacci(n - 2); + } +}
\ No newline at end of file |