CSS 220 Module 6 Homework
CSS 220 Module 6 Homework
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
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.
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]
DETAILED ASSIGNMENT