MCPcopy Create free account
hub / github.com/covscript/covscript / recursive

Function recursive

tests/benchmark.py:48–53  ·  view source on GitHub ↗

Simple recursive counting function

(depth)

Source from the content-addressed store, hash-verified

46
47# ---------------------- Recursion Performance ----------------------
48def recursive(depth):
49 """Simple recursive counting function"""
50 if depth <= 0:
51 return 0
52 else:
53 return 1 + recursive(depth - 1)
54
55
56def test_recursion(num_tests, depth):

Callers 1

test_recursionFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_recursionFunction · 0.68