CREATE PYTHON PROGRAM OF THIS QUESTIONS. THANK YOU AND EXPLAIN HOW IT WORKS SO I CAN KNOW THE LOGIC, SHOW THE CODE AND OUTPUT
Create a Python program for the given problem:
Part 1: Sort Algorithm Program A: Insertion Sort
Assume the following list of keys: 28, 18, 21, 10, 25, 30, 12, 71, 32, 58, 15
This list is to be sorted using insertion sort as described in this laboratory activity for lists. Move 10 to its proper position using insertion sort, how many key comparisons are executed?
2. Show the resulting list after six passes of the sorting phase - that is, after six iterations of the for loop.
3. Exactly how many key comparisons are executed to sort this list using insertion sort?
Problem B: Algorithm Analysis
What is the best case, worst case, and average case complexity of insertion sort algorithms?
Create a program for the given problem using insertion sorting algorithm. Compute for the age, then sort the age according to the following:
[1] Ascending Order
[2] Descending Order
In this section, we look at a program that keeps your friends' names and birthdays. Each entry in the dictionary uses a friend's name as the key and that friend's birthday as the value. You can use the program to look up your friends' birthdays by entering their names.
The program displays a menu that allows the user to make one of the following choices:
1. Add a new birthday
2. Edit a birthday
3. Delete a birthday
4. Quit the program
The program initially starts with an empty record, so you have to choose an option from the menu to add a new entry. Once you save a birthday, you can choose an item to look up a specific person or to change an existing birthday in the dictionary. Item 5 is to quit the program.
Compute the age and then sort the age according to the following:
[1] Ascending Order
[2] Descending Order