What could we conclude about the input to sorting algorithm


Assignment

Part 1: Step by Step Sorting

Show the steps taken by each sort on the following unordered list of integers (duplicate items are denoted with letters):

4, 1, 6, 8, 9, 2, 3

• Insertion Sort

• Selection Sort

• Bubble Sort

Part 2: Short Answer

• We have a system running insertion sort and we find that it's completing faster than expected. What could we conclude about the input to the sorting algorithm?

• Give a 5-element array such that it elicits the worst-case runtime for bubble sort.

Part 3: Python Programming

Submit a Python file for each of the following. Do not use prebuilt Python functions/methods. These should be solved using loops and comparisons.

• Find the smallest and largest numbers in the following unsorted list: [4, 2, 7, 3, 8, 5]

• Find the smallest missing element from the following sorted list: [1, 2, 3, 5, 6, 7, 9]

• Count the number of occurrences of the number 7 in the following sorted list: [1, 2, 2, 2, 5, 7, 7, 7, 8, 9]

Format your assignment according to the give formatting requirements:

1. The answer must be double spaced, typed, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also includes a cover page containing the title of the assignment, the course title, the student's name, and the date. The cover page is not included in the required page length.

3. Also include a reference page. The references and Citations should follow APA format. The reference page is not included in the required page length.

Solution Preview :

Prepared by a verified Expert
Python Programming: What could we conclude about the input to sorting algorithm
Reference No:- TGS03142365

Now Priced at $30 (50% Discount)

Recommended (93%)

Rated (4.5/5)