These ICS4U Grade 12 Computer Science python coding questions will form a part of your final grade for this course and are to be handed in for grading.
For all of the following questions:
Your grade will be based on your ability to demonstrate the overall expectations from the Ontario Computer Studies Curriculum
A3 – Designing Algorithms
A4 – Code Maintenance
C2 – Analyze Algorithms
Since you will be using File Input and Output in these questions, store the name of your data file in a variable in the very first line at the top of your program. Then use that variable in your code to open the file.
The reason for this is so that I can easily change the file name with my own test data when grading. I won’t have to go and change anything in your code other than the first line.
#Example
inputPath = "dataFileIN.txt"
outputPath = "dataFileOUT.txt"
#Use that variable in your code
file = open(inputPath,"r")
File Name: “ICS4UFrequencySearch.py”
There are an unknown amount of integers stored one per line in a data file.
Write a function that will find the Nth most frequent integer that occurs in that file
Create a main function that reads the data file and allows the user to pick Nth most frequent.
File Names -> You decide
In this question you are going to experimentally test the Time Complexities for the Best, Average, Worst cases, for the Insertion Sort Algorithm
For each case create a graph of Run Time vs Number of elements and then compare it to the Big O Notation discussed in the Lessons
Collecting Data
Graphing Option #2 – Matplotlib in Python
Hand in:
Return to ICS4U Main Page