Question: Create an DIVIDE - AND - CONQUER algorithm that has a complexity of O(nlogn) with PYTHON to find the number of reverse pairs in
Create an "DIVIDE - AND - CONQUER" algorithm that has a complexity of O(nlogn) with PYTHON to find the number of reverse pairs in an array. Use any library in python to help create the algorithm.
Suppose that we are given an array of randomly generated 100 numbers. A reverse is a pair (t_i, t_j) s.t i < j, however, t_i > t_j.
For example, suppose that there exists the array {10, 9, 7, 13, 99, 70, 71, 80,.............., t_n}, where n_1 = 10, n_2 = 9, n_3 = 7, n_4 = 13, n_5 = 99, and on so forth, then
Reverse 1: 10 > 9
Reverse 2: 99 > 70
Reverse 3: 99 > 71
Reverse 4: 99 > 80
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
