Control flow & Cyclomatic complexity procedure

def find_product(list_products, item):
    first = 0
    last = len(list_products)-1
    found = False
    while first<=last and Not Found:
        midpoint = (first + last)/2
        if list_products[midpoint] == item:
            found = True
        else:
            if item < alist[midpoint]:
                last = midpoint - 1
            else:
                first = midpoint + 1
    return found

Я должен найти цикломатическую сложность для этого кода, а затем предложить несколько тестовых случаев белого ящика и теста черного ящика. I have a solution but i don´t know if mine is correct, so i would like some help of this community.

Был бы признателен за помощь в тестовых случаях.

0 ответов

Другие вопросы по тегам