Question: project to track students' assessment data on a specific learning objective ( LO ) throughout the semester. We currently have two lists of grades, each

project to track students' assessment data on a specific learning objective (LO) throughout the semester. We currently have two lists of grades, each sorted in descending order, representing the latest assessment results for our students. Each grade appears as a pair (technically, a tuple) of values (ID, grade), where ID represents the student's unique identifier, and grade is their corresponding assessment grade.
IDs are unique within each list (since each student is unique), but a student's ID may appear in both lists with different grades. In the latter cases, we want to find the maximum of the two grades and put it correctly within the sorted final list (in descending order). Here are a few other requirements:
*If a student's ID appears in only one list, use that grade as is.
*If two students end up having the same final grade, to present the output, these IDs should be sorted by descending order.
Below is an example of what our algorithm should be able to produce:
Eg.
Input:
list1=[(1,5),(5,3),(2,3),(4,2)]
list2=[(3,5),(4,3),(1,2)]
Output:
[(3,5),(1,5),(5,3),(4,3),(2,3)]-
Note how students 2 and 4 share the same final grade (in this case, 3), and the output returns first student 4 and then student 2.
A. A possible brute-force approach to this problem would start by concatenating the two lists, arranging them by id, retaining the maximum grade for each, and then using a sorting algorithm to get the desired result, like:
Concatenate step : [(1,5),(5,3),(2,3),(4,2),(3,5),(4,3),(1,2)]
Group step: [(1,5),(1,2),(2,3),(3,5),(4,2),(4,3),(5,3)]
Calculation step: [(1,5),(2,3),(3,5),(4,3),(5,3)]
Sort step: [(3,5),(1,5),(5,3),(4,3),(2,3)]
*Note that in the group step, the only requirement is for the duplicate IDs to be side-by-side (there is no sorting requirement at all in this specific step).
In the code cell provided below, implement this algorithmic strategy using the function name provided. In the sorting step, described above, you make a call to selection sort (which you will need to implement on your own). Demonstrate that it works with at least three test cases. Explain why your test cases are appropriate or sufficient in the companion text cell below.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!