Esempio n. 1
0
def build_min_height_bst_from_sorted_array_wrapper(executor, A):
    result = executor.run(
        functools.partial(build_min_height_bst_from_sorted_array, A))

    if generate_inorder(result) != A:
        raise TestFailure('Result binary tree mismatches input array')
    return binary_tree_height(result)
def build_min_height_bst_from_sorted_array_wrapper(executor, A):
    result = executor.run(
        functools.partial(build_min_height_bst_from_sorted_array, A))

    if generate_inorder(result) != A:
        raise TestFailure("Result binary tree mismatches input array")
    return binary_tree_height(result)
def build_min_height_bst_from_sorted_array_wrapper(timer, A):
    timer.start()
    result = build_min_height_bst_from_sorted_array(A)
    timer.stop()

    if generate_inorder(result) != A:
        raise TestFailureException("Result binary tree mismatches input array")
    return binary_tree_height(result)
Esempio n. 4
0
 def get_metrics(self, x):
     return [binary_tree_size(x), binary_tree_height(x)]