Question
solve
![Given an array of different integers, replace each element by its corresponding
descending order in the array. The maximum array element has the order 1; the second
maximum element has order 2, and so on...
For example,
Input: {10, 12, 17, 14, 8, 3, 22}
Output: {5, 4, 2, 3, 6, 7, 1}
a) Design a brute-force algorithm to solve this problem
complexity of your solution
and analyse the
b) Design a more efficient algorithm to do the same task with less complexity
and analyse the complexity of your solution...
c) Develop a python code to implement your efficient algorithm. (
depend on the correctness of the code, indentation, comments, test-case]
d) Prepare a brief report (250 words) comparing the two algorithms](https://content.bartleby.com/qna-images/question/f7037fa1-d9ae-4bcc-aba2-58f628bd28fc/c888b2fd-b721-48ba-88ae-94d372240091/3ry4vho_thumbnail.png)
Transcribed Image Text:Given an array of different integers, replace each element by its corresponding
descending order in the array. The maximum array element has the order 1; the second
maximum element has order 2, and so on...
For example,
Input: {10, 12, 17, 14, 8, 3, 22}
Output: {5, 4, 2, 3, 6, 7, 1}
a) Design a brute-force algorithm to solve this problem
complexity of your solution
and analyse the
b) Design a more efficient algorithm to do the same task with less complexity
and analyse the complexity of your solution...
c) Develop a python code to implement your efficient algorithm. (
depend on the correctness of the code, indentation, comments, test-case]
d) Prepare a brief report (250 words) comparing the two algorithms
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 6 steps with 2 images

Knowledge Booster
Similar questions
- QUADRATIC PRIMES This question is adopted from Project Euler Question 27. (https://projecteuler.net/problem=27) The quadratic formula n^2 + n + 41 will produce 40 primes for consecutive integer values 0 <= n <= 39. However, when n = 40, this formula will not generate a prime number. Another interesting quadratic formula n^2 – 79n + 1601 produces 80 prime numbers for consecutive values 0 <= n <= 79. The Question: find a and b such that when -999 <= a <= 999 and -1000 <= b <= 1000, the quadratic form ?^2 + ? × ? + ? produces the maximum number of primes for consecutive values of n, starting with n = 0. Requirement: MUST BE WRITTEN IN C++ - Print the 40 primes generated by formula n 2 + n + 41 - Print the 80 primes generated by formula n 2 – 79n + 1601 - Write a function that takes in an integer and returns whether the given number is prime or not. - Output the value of a, b and how many consecutive values of n (count the starting zero!) can be generated. - Submit…arrow_forward2. If n is a positive integer, then n4 - n is divisible by 4. [Proof of Exhaustion]arrow_forward