<jupyter_start><jupyter_text>Assignment 2- Implement the search algorithm you came up with in pseudocode with Python- Test the search algorithm with a list of 10,100,1000 random numbers (sorted with your sorting algorithm) and compare the result using the %time to time your code and submit your results in code comments  PseudocodeGet a sorted list and a search term. Loop through the sorted list:    Compare the item to the search term.         If the search term matches the item:            return the couter value        Add one to the counter<jupyter_code>import random<jupyter_output><empty_output><jupyter_text>The algorithm<jupyter_code># Simple brute force search engine

def ownsearch(sorted_list, search_term):
    counter = 0
    for i in sorted_list:
        if search_term == i:
            return "I found the term " + str(search_term) + " the first time at index " + str(counter)
        counter += 1
sorted_list = ['Alma', 'Annus', 'Mater', 'mirabilis']
search_term = 'Mater'

print(ownsearch(sorted_list,search_term))<jupyter_output>I found the term Mater the first time at index 2<jupyter_text>Testing the algorithm<jupyter_code># The algorithm from the previous assignment

def ownsort(int_list):
    for i in range(len(int_list) - 1):
        k = i
        for j in range(i + 1, len(int_list)):
            if int_list[j] < int_list[k]:
                k = j
        int_list[i], int_list[k] = int_list[k], int_list[i]
    return int_list
# Generate Lists with Random numbers 

int_list_10 = []
for i in range(0,10):
    int_list_10.append(random.randint(1,100))

int_list_100 = []
for i in range(0,100):
    int_list_100.append(random.randint(1,100))

int_list_1000 = []
for i in range(0,1000):
    int_list_1000.append(random.randint(1,100))
# Generating random int for search term

search_term = random.randint(1,100)

# Generating sorted list
int_list_10 = ownsort(int_list_10)

print(ownsearch(int_list_10, search_term))

%time<jupyter_output>None
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 5.01 µs<jupyter_text>Result of %time:CPU times: user 0 ns, sys: 0 ns, total: 0 nsWall time: 5.01 µs<jupyter_code># Generating random int for search term

search_term = random.randint(1,100)

# Generating sorted list
int_list_100 = ownsort(int_list_100)

print(ownsearch(int_list_100, search_term))

%time
Result of %time:

CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 5.72 µs
# Generating random int for search term

search_term = random.randint(1,100)

# Generating sorted list
int_list_1000 = ownsort(int_list_1000)

print(ownsearch(int_list_1000, search_term))

%time
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 5.01 µs<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09053954175905396, 'fraction_numerical': 0.04434589800443459, 'mean_word_length': 4.266536964980545, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '520395', 'license': 'MIT', 'n_tokens_mistral': 1007, 'n_tokens_neox': 915, 'n_words': 303, 'path': 'homework/03 Search, list functions/homework/born_mathias_2_2.ipynb', 'repo_name': 'barjacks/algorithms_mine', 'size': '2706'}