We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dd7f65 commit 2f0cea7Copy full SHA for 2f0cea7
pydatastructs/trees/tests/benchmarks/test_binary_trees.py
@@ -17,6 +17,10 @@ def f(backend):
17
b = BST(backend=backend)
18
for node in range(-1000,1000):
19
b.insert(node, node)
20
+ for node in range(-1000, 1000):
21
+ b.search(node)
22
+ for node in range(2000):
23
+ b.delete(node)
24
25
backend_dict = {"backend": Backend.PYTHON}
26
timer_python = timeit.Timer(functools.partial(f, **backend_dict))
@@ -25,5 +29,6 @@ def f(backend):
29
backend_dict = {"backend": Backend.CPP}
30
timer_cpp = timeit.Timer(functools.partial(f, **backend_dict))
27
31
cpp_backend = min(timer_cpp.repeat(repeat, number))
28
-
32
+ print("Python time: ", python_backend)
33
+ print("C++ time: ", cpp_backend)
34
assert cpp_backend < python_backend
0 commit comments