Question: Write a Python function MoM7Pos(arr) that accepts a list arr of integers( not necessarily distinct) and computes the median of medians(of blocks) M dividing

Write a Python function MoM7Pos(arr) that accepts a list arr of integers(






Write a Python function MoM7Pos(arr) that accepts a list arr of integers( not necessarily distinct) and computes the median of medians(of blocks) M dividing the list arr into blocks of 7 and returns the position of M in arr if it were sorted. If M is repeated more than once in the list arr return the index of first occurrence of M in arr if it were sorted. For simplicity the size of arr will be a multiple of 7. Your solution should run in O(n) time. Sample Input 44 9 31 12 15 98 48 45 13 75 23 6 35 74 Sample Output 1 7 ses Assignment

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!