c6dd9753893533934c7804bb714bbce2de8dd1a7,searches/ternary_search.py,,,#,87

Before Change


    try:
        __assert_sorted(collection)
    except ValueError:
        sys.exit("Sequence must be sorted to apply the ternary search")

    target_input = input("Enter a single number to be found in the list:\n")
    target = int(target_input)
    result1 = ite_ternary_search(collection, target)

After Change


    user_input = input("Enter numbers separated by comma:\n").strip()
    collection = [int(item.strip()) for item in user_input.split(",")]
    assert collection == sorted(collection), f"List must be ordered.\n{collection}."
    target = int(input("Enter the number to be found in the list:\n").strip())
    result1 = ite_ternary_search(collection, target)
    result2 = rec_ternary_search(0, len(collection) - 1, collection, target)
    if result2 != -1:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: TheAlgorithms/Python
Commit Name: c6dd9753893533934c7804bb714bbce2de8dd1a7
Time: 2020-11-14
Author: posorio@sier.com.co
File Name: searches/ternary_search.py
Class Name:
Method Name:


Project Name: NervanaSystems/nlp-architect
Commit Name: 794bd558da80b65713b51a964ec61e7ef36d4bf2
Time: 2018-05-14
Author: peteriz@users.noreply.github.com
File Name: examples/intent_extraction/interactive.py
Class Name:
Method Name:


Project Name: mtobeiyf/audio-classification
Commit Name: 190025363107197f1704a06e21717af0ca577f18
Time: 2018-11-25
Author: mvrozanti@hotmail.com
File Name: cnn.py
Class Name:
Method Name: train