This Module will provide an introduction to algorithms, measures of algorithm efficiency, and algorithm bias
Post some or all of your code from Assignment 4 so you can share it with the class
and tell us about your brilliant solutions or terrible struggles. Find the html file named with your initials
(SP.html, for example) here: https://github.com/ICS4U-ICS4C/2018-Fall-4/tree/gh-pages/Brilliant.
Replace the sample code with your own code and edit the description or other elements to your liking.
Make a pull request so that I can merge your changes to the class site.
There's a link to your page in Module 4, if you scroll to the bottom.
Watch these clips on pseudocode, flowcharts, and algorithms
Algorithms Worksheet, supplement to this video lecture from MIT CS
Highly Recommended Reading: Weapons of Math Destruction by Cathy O'Neil
Or Watch a brief video from her blog, mathbabe.com, below
Also see Joy Buolamwini's Ted Talk about fighting algorithm bias below
Sorting and Searching Algorithms in Python
Algorithm Complexity Summary Diagram
(compliments of @Manav-Shardha)
#http://interactivepython.org/courselib/static/pythonds/SortSearch/TheMergeSort.html
#backgound and sample on merge sort
def merge_sort(num_list):
i = 0
j = 0
sorted_list = []
if len(num_list) > 1:
mid = len(num_list)//2
part_one = num_list[:mid]
part_two = num_list[mid:]
part_one = merge_sort(part_one)
part_two = merge_sort(part_two)
else:
return num_list
while True:
if part_one[i] < part_two[j]:
sorted_list.append(part_one[i])
i+=1
else:
sorted_list.append(part_two[j])
j+=1
if (i >= len(part_one)):
sorted_list = sorted_list + part_two[j:]
break
elif (j >= len(part_two)):
sorted_list = sorted_list + part_one[i:]
break
return sorted_list
print(merge_sort(num_list))
Quiz 4: ?
Quiz 5: May 3
This work and other materials under
github.com/ICS4U-ICS4C,
are licensed under Creative Commons Attribution 4.0 Int'l License.