<jupyter_start><jupyter_text>Homework (9 pts) - AlgorithmsQuestions below refer to the **Selection Sort** algorithm. See image depiction below.![Selection Sort](images/selectionsort.jpg) 1. (3 pts) Write a breif high level natural language description of how you would implement the selection sort algorithm.<jupyter_code>Swap the minimum unsorted item with the first unsorted item.
Repeat until all items are sorted.<jupyter_output><empty_output><jupyter_text>2. (3 pts) Write pseudocode for the selection sort algorithm.<jupyter_code>FOR each item index
    Find the minimum item from index to end
    Swap the minimum item with the item at index<jupyter_output><empty_output><jupyter_text>3. (3 pts) Write a function implementing the selection sort algorithm on an input list.<jupyter_code>def selectionSort(items):
    N = len(items)
    for i in range(N):
        minIndex = i
        for j in range(i, N):
            if items[j] < items[minIndex]:
                minIndex = j
        if minIndex != i:
            items[i], items[minIndex] = items[minIndex], items[i]<jupyter_output><empty_output><jupyter_text>4. (3 pts) Use your function to sort the list of items below. Print your sorted items to verify.<jupyter_code>import numpy as np

items = np.random.randint(0, 10, 20)
items
selectionSort(items)
items<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08382789317507418, 'fraction_numerical': 0.010385756676557863, 'mean_word_length': 4.290196078431372, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 17, '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': '222369', 'license': 'Unlicense', 'n_tokens_mistral': 415, 'n_tokens_neox': 404, 'n_words': 148, 'path': 'homework/key-algorithms.ipynb', 'repo_name': 'nishadalal120/NEU-365P-385L-Spring-2021', 'size': '1348'}